Home > DeveloperSection > Forums > Using routes in ASP.NET Gridview Hyperlinks
Manoj Bhatt
Manoj Bhatt

Total Post:153

Points:1079
Posted on    August-23-2014 7:35 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 554  View(s)
Rate this:

I have a Gridview with a Hyperlink column. I want to route(Navigate) using hyperlinks depending on the id value from the database.

<asp:HyperLinkField  DataNavigateUrlFields="id"

                      DataNavigateUrlFormatString="product" DataTextField="pName"

                      HeaderText="Product Name" 

       NavigateUrl='<%$ RouteUrl:id=Eval("id"), routename = ProductRoute%>'

       />

This results in an error message:

404 page not found

How can this be fixed?



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-23-2014 8:48 AM

Hi manoj, 

Try creating the link in the RowDataBound event handler in your code-behind and debug it there.


Don't want to miss updates? Please click the below button!

Follow MindStick