I am tring to use the code below so that when a user clicks on "Edit" on my gridview it passes the data to the other page and populates the text boxes. For some reason it is not firing? Any ideas?
Protected Sub GridView1_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
If e.CommandName = "Edit" Then
Dim index As Integer = Convert.ToString(e.CommandArgument)
Dim row As GridViewRow = GridView1.Rows(index)
Session("Test") = Server.HtmlDecode(row.Cells(3).Text)
End If
End Sub
Yes, I set a break point that is how I no it isnt being fired.
Partial Class ListAllProjects
Inherits System.Web.UI.Page
Protected Sub GridView1_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
If e.CommandName = "Edit.." Then
Dim index As Integer = Convert.ToString(e.CommandArgument)
Dim row As GridViewRow = GridView1.Rows(index)
Session("Test") = Server.HtmlDecode(row.Cells(3).Text)
End If
End Sub
End Class
MKozlowski
Member
500 Points
573 Posts
Passing gridview values to another page
May 11, 2012 02:47 PM|LINK
Hi,
I am tring to use the code below so that when a user clicks on "Edit" on my gridview it passes the data to the other page and populates the text boxes. For some reason it is not firing? Any ideas?
Protected Sub GridView1_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand If e.CommandName = "Edit" Then Dim index As Integer = Convert.ToString(e.CommandArgument) Dim row As GridViewRow = GridView1.Rows(index) Session("Test") = Server.HtmlDecode(row.Cells(3).Text) End If End Subrobwscott
Star
8079 Points
1491 Posts
Re: Passing gridview values to another page
May 11, 2012 03:00 PM|LINK
post your aspx code as well please. have you set a breakpoint on your event?
Mark Answered if it helps - Good luck!
Cheers!
Design And Align
- Rob
MKozlowski
Member
500 Points
573 Posts
Re: Passing gridview values to another page
May 11, 2012 03:05 PM|LINK
Yes, I set a break point that is how I no it isnt being fired.
Partial Class ListAllProjects Inherits System.Web.UI.Page Protected Sub GridView1_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand If e.CommandName = "Edit.." Then Dim index As Integer = Convert.ToString(e.CommandArgument) Dim row As GridViewRow = GridView1.Rows(index) Session("Test") = Server.HtmlDecode(row.Cells(3).Text) End If End Sub End ClassMKozlowski
Member
500 Points
573 Posts
Re: Passing gridview values to another page
May 11, 2012 03:24 PM|LINK
Please ignore I have it working with datanavigateurlstring property.