Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid HyperLinkColumn question.

Status
Not open for further replies.

jkl

Programmer
May 16, 2001
83
US
the HyperLinkColumn object is great, but is there any way to pass more than one datafield to the url?

change this:
DataNavigateUrlField="albumID" DataNavigateUrlFormatString="albumDetails.aspx?id={0}"

to:
DataNavigateUrlField="albumID" DataNavigateUrlFormatString="albumDetails.aspx?id={0}&artistName={someOtherField}"
 
We sort of covered this a while back, and I still swear I've seen it done. Try this syntax:

DataNavigateUrlField="albumID,artistName" DataNavigateUrlFormatString="albumDetails.aspx?id={0}&artistName={1}"

But if that doesn't work, then you'll need to use a databinder statement to output it:

<asp:linkbutton.....

navigateURL=&quot;albumDetails.aspx?id=
<%# DataBinder.Eval(Container.DataItem,&quot;albumID&quot;) %>
&artistName=
<%# DataBinder.Eval(Container.DataItem,&quot;artistName&quot;) %>&quot;

here's hoping the first example works ;-)
paul
penny1.gif
penny1.gif
 
Actually I ended up using a DataList object and using the DataBinder on a label.

The multiple field doesn't work for the DataNavigateUrlField. Oh well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top