Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

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

Avatar of derrekdeveloper
derrekdeveloperFlag for United States of America asked on
ASP.NET
1 Comment1 Solution649 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
Avatar of Stephan
StephanFlag of Netherlands imageLead Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answers