通过单击链接按钮获取索引ID

时间:2013-08-08 11:59:10

标签: vb.net gridview

如何获取特定点击链接按钮的索引ID到网格视图中的下一页?

我的代码:我在这里使用隐藏字段

If e.CommandName = "facilitywell" Then
    Dim routeId As String = CType(gView.Rows(indexNum).FindControl("lblpid"), Label).Text
    'CType(gView.Rows(indexNum).FindControl("hfRouteid"), HiddenField).Value
    Response.Redirect("~/frmRouteFacilityWell.aspx?routeId=" + routeId

源页码:

<asp:LinkButton ID="lbRouteFacilityWell" runat="server" CommandName="facilitywell">FacilityWell</asp:LinkButton>

1 个答案:

答案 0 :(得分:1)

 lblpid= gView.SelectedRows(0).Cells("lblpid").Value

试试这个