且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

单击GridView中的一行

更新时间:2023-08-28 22:37:16

根据我的理解你的要求是什么,如果你点击gridview行,根据你要重定向到另一个页面的行ID。



如果你需要,那么使用gridview的HyperLinkField,并使用下面的属性



1)DataNavigateUrlFields:查询字符串字段

2)DataNavigateUrlFormatString:该页面的URL



As per my understand the thread your requirement is, If you click on gridview row, based on row id you wants to redirect to another page.

If that is your need, then use HyperLinkField of gridview, and use below properties

1) DataNavigateUrlFields : Query string fields
2) DataNavigateUrlFormatString : URL of that page

<asp:hyperlinkfield text="View" datanavigateurlfields="Id,Desc,Short_Desc" datanavigateurlformatstring="~/Page2.aspx?CL_Id={0}&CL_Desc={1}&CL_Short_Desc={2}" xmlns:asp="#unknown" />





有关详细信息,请参阅以下链接

http://www.dotnetspider.com/resources/45377-How-pass-Gridview-Parameters-another-page-using -HyperLinkField.aspx [ ^ ]