Hello, folks. I have been fighting with this issue for a few weeks and cannot seem to get anywhere with it. Thus, I have decided to give you guys as much possible information as I can get into a post and hopefully someone will be able to see what I am doing wrong.
First of all, I am using ASP.NET 2.0. I have a gridveiw and a sqldatasource.

The first field, ClientID is a template with a button, obviously. When I click the button, I want the text value, in this case, "2", sent to the session variable.
The gridview is named grdSearch with the DataKey property set to ClientID, and the button, while I named it btnSelect, the .NET framework chooses to still create the click event as Button1_Click.
At any rate, here is the code-behind that I have tried (along with a dozen or so variations) but I still get the "Unhandled Null Exeption".
Protected Sub Button1_Click(B yVal sender As Object, ByVal e As System.EventArg s)
What the heck am I doing wrong?
First of all, I am using ASP.NET 2.0. I have a gridveiw and a sqldatasource.

The first field, ClientID is a template with a button, obviously. When I click the button, I want the text value, in this case, "2", sent to the session variable.
The gridview is named grdSearch with the DataKey property set to ClientID, and the button, while I named it btnSelect, the .NET framework chooses to still create the click event as Button1_Click.
At any rate, here is the code-behind that I have tried (along with a dozen or so variations) but I still get the "Unhandled Null Exeption".
Protected Sub Button1_Click(B yVal sender As Object, ByVal e As System.EventArg s)
Session("Client ID") = grdSearch.Selec tedDataKey.ToSt ring
End SubWhat the heck am I doing wrong?
Comment