‘System.String’ to ‘System.Guid’

 Hi Guys,

 I have this working with a hyperlink field in a gridview.

  

            <asp:HyperLinkField DataNavigateUrlFields="UserID" DataNavigateUrlFormatString="userprofiles.aspx?UserID={0}"
                DataTextField="UserName" HeaderText="User Name" Text="User Name" >

 

 

I just want to same thing in a datagrid but I get this error:

  

<asp:HyperLink ID="HyperLinkToUserProfile" runat="server" NavigateUrl="userprofiles.aspx?UserID={0}"><%# Eval("UserName")%></asp:HyperLink>

 

Cannot convert value of parameter 'UserID' from 'System.String' to 'System.Guid'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Cannot convert value of parameter 'UserID' from 'System.String' to 'System.Guid'

 

Does anyone know how to fix this?

 

many thanks

polynaux 

Read More

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s