Question : Using hyperlink control within a sqldatasource datalist control to pass a querystring value coming from the sqldatasource

I am trying to use a hyperlink control within a data list. The problem I have is I do not know the correct syntax to pass the data value coming from the SQLDataSource. Here is my scenario:



I have a SQLDataSource. It is bringing back multiple values including a field called eid which is an int value.  I need to place a hyper within the datalist and go to a page called favorites. I need to pass the eid value coming back from the SQLDataSource to the favorite.aspx page. I did a databind on the hyperlink and I am able to use the hyperlink to go to a page but the databinding appears to be for the text value only. Not to pass the eid 'field' value in QueryString to the favorites.aspx page, which is what I need to do. I tried to add the eid value by using this code, ?eid={0} but it does not work. Here is the code I have so far:

<asp:HyperLink ID="HyperLink1" runat="server" ForeColor="White" Text='<%# Eval("eid") %>' NavigateUrl="~/favorites_addexercise.aspx?eid={0}"></asp:HyperLink>

Answer : Using hyperlink control within a sqldatasource datalist control to pass a querystring value coming from the sqldatasource

yes you can, take a look http://www.petefreitag.com/item/244.cfm
Random Solutions  
 
programming4us programming4us