我是这个编程领域(ASP.NET VB)的新手,我想知道是否有人对我有帮助,这样我就可以让事情顺利进行,我将不胜感激!我目前正在使用代码在没有“选择”按钮(下图)的 Gridview 中选择整行(PatientName & Room)。然后我想将这些从行传递到下一页。接收页面将有两个标签。这就是我迷路的地方。
我知道那里有例子,但我找不到适合我的例子,除非有人能指出我正确的方向。谢谢
Private Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
'Allows you to "select"/Highlight a row without a select button
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes("onmouseover") = "this.style.cursor='pointer';this.style.backgroundColor = '#87CEFF';"
e.Row.Attributes("onmouseout") = "this.style.textDecoration='none';this.style.backgroundColor = '#FFFFFF';"
e.Row.ToolTip = "Click to select row"
e.Row.Attributes("onclick") = Me.Page.ClientScript.GetPostBackClientHyperlink(Me.GridView1, "Select$" & e.Row.RowIndex)
End If
End Sub