I have a datagrid with a button control in a template field. When the button is clicked it runs a piece of VB code. The first thing the code needs to run properly is the selected data key value for the row the button is in. I have not been able to get this part working...the rest of the code executes just fine, but the row value is always zero. How do I get the row data key value using VBScript? Here is the code in it's current state...I need to read the selected value for the row into the variable 'lotno'. The button command name is 'Select'...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim lotno As Long
lotno = GridView1.SelectedValue
Response.Cookies("auctionn
um").Value
= lotno
Response.Redirect("cancela
uction.asp
x")
End Sub
Start Free Trial