I am trying to user Server.Transfer in the RowCommand event from a gridview (which is inside an UpdatePanel), however I keep getting a javascript error "Object Required".
I've tried changing the gridview to use templates, button, imagebuttons, etc and cannot find a way to transfer the page.
Protected Sub gvTest_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvTest.RowCommand
Select Case UCase(e.CommandName.ToString)
Case "EDIT"
aPubProperty = Convert.ToInt32(e.CommandArgument)
error--> Server.Transfer("~/toEditPage.aspx",True)
Case "DELETE"
End Select
End Sub
Then I am attempting to retrieve the property in the PageLoad of the redirected page:
If Not Page.PreviousPage Is Nothing Then
If PreviousPage.IsCrossPagePostBack Then
lblTest.Text = PreviousPage.aPubProperty.ToString
End If
End If
Has anyone gotten this to work or found a solution?
Thank You,
Michael