在我的代碼如下,我的("OnClick")
沒有射擊。有誰知道爲什麼?點擊事件沒有從後面的代碼發射
e.Row.Cells(1).Attributes("OnClick") = "window.location.href='MachineSweepLite.aspx?AreaID='" _
+ GridView1.DataKeys(e.Row.RowIndex).Values("ID").ToString()
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(1).Attributes("onmouseover") = "this.style.cursor='hand';this.style.textDecoration='underline';"
e.Row.Cells(1).Attributes("onmouseout") = "this.style.textDecoration='none';"
Dim Index As Integer = e.Row.RowIndex
e.Row.Cells(1).Attributes("OnClick") = "window.location.href='MachineSweepLite.aspx?AreaID='" + GridView1.DataKeys(e.Row.RowIndex).Values("ID").ToString
End If
End Sub
上面編輯。
你能改正你的代碼並完全發佈嗎? –
我不明白你? – Kallumasaurus
@Kallumasaurus在這裏發佈完整的代碼,不僅僅是一個屬性添加行。 –