2

I have a button that does a server.transfer to another aspx page. On the second page is a form with submit button. When clicking the submit button the page_load 'if not ispostback code' executes and wipes the form clear.

'First page
Context.Items.Add("ID", myID)
Server.Transfer("SecondPage.aspx")

'Second page
Protected Sub Page_Load(sender As Object, e As EventArgs)
    If Not IsPostBack Then
        ClearControls()
        _myID = Context.Items("ID")
        BindDropDowns()
    End If
End Sub

Protected Sub btnSave_Click(sender As Object, e As EventArgs)
    'Do save functions here
End Sub

Is this expected behavior of server.transfer? I will resort to responce.redirect but I would prefer to use server.transfer

Any thoughts or input is appreciated, thanks

Dan
  • 61
  • 1
  • 10

1 Answers1

1
Server.Transfer("SecondPage.aspx", True)
Wize
  • 1,040
  • 9
  • 20