views:

39

answers:

2

When I bind a url using the productID field from my access database it returns the wrong value for example as my database starts with the first field as 2 it returns -1, then -2 for 3 and so on.

<a href='details.aspx?ID=<%#Eval("ProductID") %>'>

thanks

A: 

Try <a href="details.aspx?ID='<%#Eval("ProductID") %>'">

or

use asp hyperlink

<asp:HyperLink runat="server"
 NavigateUrl='details.aspx?ID=<%# Eval("ProductID") %>'
/>
Pandiya Chendur
no it doesnt work sorry
john
john try hyperlink
Pandiya Chendur
A: 

try:

<a href="details.aspx?ID='<%# DataBinder.Eval(Container.DataItem, "ProductId")%>'">
Pragnesh Patel