VB .NET & ASP on a columnbutton
Hi all, i am doing a new asp project using visual studio .net (VB.NET), what i have done by this code, i have binded the datagrid to a datareader and then added a columnbutton, this code works very fine but . it seems i cant trap the click event on the button in the column
Can anyone advise me in details how can i track the click button and identify which item in the grid is clicked to open the alternative page.
HERE IS MY CODE
VB Code:
If IsPostBack = False Then
Dim db As New OleDb.OleDbConnection(dbstring), cmd As New OleDb.OleDbCommand(Session("sql"), db), readx As OleDb.OleDbDataReader
Dim colx As New ButtonColumn()
colx.CommandName = "viewcmd"
colx.ButtonType = ButtonColumnType.PushButton
colx.Text = "View"
db.Open()
readx = cmd.ExecuteReader
dbgrid1.DataSource = readx
dbgrid1.Columns.Add(colx)
dbgrid1.DataBind()
readx.Close()
db.Close()
Exit Sub
End If
THX in Advance