QueryString Value Not Passed through HyperLinkField.DataNavigateUrlFormatString

  • Thread starter Thread starter HillBilly
  • Start date Start date
H

HillBilly

MSDN doc http://tinyurl.com/lzz857 says their example will
pass the value of the bound field UnitPrice through the
formatter as the value for the ProductID QueryString.

But my code used in a GridView Column template will
only pass the formatter as literal text i.e. {0}
which shows up in the URL of the page as
Homepage.aspx?tweetContents={0}

// MSDN
<asp:hyperlinkfield datatextfield="UnitPrice"
datatextformatstring="{0:c}"
datanavigateurlfields="ProductID"
datanavigateurlformatstring="~\details.aspx?ProductID={0}"
headertext="Price"
target="_blank" />

// my code
<asp:HyperLinkField
DataNavigateUrlFields="TweetContents"
DataNavigateUrlFormatString="~/Homepage.aspx?tweetContents={0}"
NavigateUrl="~/Homepage.aspx?tweetContents={0}"
HeaderText="ReTweet"
Text="Send Again" />
 
Back
Top