Using routes in ASP.NET Gridview Hyperlinks

Total Post:154


 1302  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" 
                      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?

  1. Re: Using routes in ASP.NET Gridview Hyperlinks

    Hi manoj, 

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


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.