if you are trying to change the URL based on the data then you might find it
easier to add to your dataset a field indicating which URL to be used. You
would then databind it to the HyperLinkField like this:
<asp:hyperlinkf ield datatextfield=" UnitPrice" datatextformats tring="{0:c}"
datanavigateurl fields="URL, ProductID"
datanavigateurl formatstring="{ 0}?ProductID={1 }" headertext="Pri ce"
target="_blank" />
in the above syntax the URL (.e.g
http://some.website.com) is saved in a
field named URL and the ProductID is a parameter to be passed in the
querystring to that URL. Notice how you can use the
datanavigateurl formatstring to compose the URL out of more than one field.
On the other hand if you wish to use a HyperLink server control within an
ItemTemplate then you can bind the data using the Eval statement:
<asp:HyperLin k ID=”hlLink1†ť runat=”server ” NavigateUrl=’ <%# Eval(“URL”) &
“?ProductID†ť & Eval(“Product ID”) %>’ Text =’<%# Eval(“UnitPri ce”)%>’/>
--
HTH,
Phillip Williams
http://www.societopia.net http://www.webswapp.com
"Vear" wrote:
I have a gridview inside a content placeholder that has the first column as a
hyperlink. I changed it from a Hyperlinkfield to a Template field so I could
name the hyperlink control. I can't figure out how to reference it so I can
change the URL depending on which Stored procedure I bind to it during form
load.
Is there a way to change it URL via VB. This is in a content form within a
master page if that makes any difference.
Thank you in advance for your help.
J