Nate Pet
Nate Pet

Reputation: 46232

asp HyperLinkField - need to show text

I have the following HyperLinkField:

     <asp:HyperLinkField DataTextField="SysID" DataNavigateUrlFields="SysID"  
      DataNavigateUrlFormatString="pgmtasklist.aspx?sysid={0}"  Text="Click Here" /> 

I need the hyperlink text to say Click Here but not working as expected. It shows the actual SysID.

Upvotes: 2

Views: 1471

Answers (1)

csm8118
csm8118

Reputation: 1213

Remove the DataTextField definition and it should work:

<asp:HyperLinkField DataNavigateUrlFields="SysID"  
    DataNavigateUrlFormatString="pgmtasklist.aspx?sysid={0}" Text="Click Here" />

Since you have DataTextField it's expecting a DataTextFormatString value as well, but in your case you don't need either.

Upvotes: 3

Related Questions