I have 2 aspx pages, in a postback event from page 1, i add data to the current context, then do a server.transfer to page 2. this all works as expected, however due to the server.transfer, the address bar still shows the url for page 1.
the weirdness comes when i click a button on page 2.
in IE (7 or 8) when i click a button on page 2, the page posts to page 2 as expected.
in Firefox when i click a button on page 2, the page posts to page 1.
Has anyone else experienced this?
Am i doing something wrong?
Is there a workaround?
this is essentially the code in page 1
Context.Items["x"] = x.Checked;
Context.Items["y"] = y.Checked;
Context.Items["z"] = z.Checked;
Server.Transfer( "page2.aspx", false );
If you’re not using
PreviousPage, you could useResponse.Redirect("~/Page2.aspx");instead. This will inform the user’s browser of the page change.Alternatively, if you are using
PreviousPageuse a cross-page post back by setting thePostBackUrlattribute on the desiredButton. This will allow yourServer.Transferlogic to be properly handled. To get access to the CheckBox’s value you will need to make public properties on Page1 that will be accessible through thePreviousPage.So Page1 will contain these properties in the code behind:
Page2 will use PreviousPage: