Sub myGridView_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles SearchGrview.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim DetailBtn As ImageButton = CType(e.Row.FindControl("btnDetail"), ImageButton)
If Not IsNothing(DetailBtn) Then
Dim planId As String = e.Row.DataItem("Plancode").ToString()
Session("searchID") = planId
DetailBtn.Attributes.Add("Onclick", "javascript:window.open('Default2.aspx','_blank');")
End If
End If
End Sub
Tag : .NET, Ms SQL Server 2008, Web (ASP.NET), VB.NET
Protected Sub GridView11_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GridView11.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim btnCorr As Button = CType(e.Row.FindControl("btnClick"), Button)
If Not IsNothing(btnCorr) Then
Dim num_material As String = e.Row.DataItem("num_material").ToString()
'Session("searchID") = num_material
btnCorr.Attributes.Add("Onclick", "javascript:window.open('correctivepage.aspx?num_material='" & num_material & ");")
End If
End If
End Sub