Muliple Select Buttons in Gridview row


I have a gridview with a select button in it.

When the button is selected it sets the value of one of the cells in a session which all works fine.

What I want to do is add another select button which sets a different cell value to a session when clicked.

The problem is I already have 1  selectedindexchange event.

I'd like another one that sets a value in a session from a different row cell. Cant work it out

Protected Sub GridView2_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles GridView2.SelectedIndexChanged
        Dim row As GridViewRow = GridView2.SelectedRow

        Session("CanvassID") = row.Cells(0).Text

    End Sub

Open in new window

Who is Participating?
CodeCruiserConnect With a Mentor Commented:
Why not set both values in above event?
EdAuthor Commented:

Thanks but the reason for not setting both values in the above event is that I want the second button to set a value and then redirect to a different page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.