开发者

Using routes in ASP.NET Gridview Hyperlinks

开发者 https://www.devze.com 2023-02-06 00:47 出处:网络
I have a Gridview with a Hyperlink column. I want to route(Navigate) using hyperlinks depending on the id value from the database.

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开发者_如何学C results in an error message:

404 page not found

How can this be fixed? .


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

0

精彩评论

暂无评论...
验证码 换一张
取 消