By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,198 Members | 1,721 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,198 IT Pros & Developers. It's quick & easy.

Page Reload After Back Button - Submit Form Twice

P: n/a
Hi

Can any one give me some help with this problem please?

Here is the scenario:

A user submits page 1 which is a web form.

After the form has been submitted they are (redirected) onto the next
page, page 2.

The user then clicks back on the browser.

They are now back in page 1

If the user clicks the continue button on page 1 this time the page
just reloads and the user has to click submit again to get to page 2.

In other words after clicking the back button the user has to submit
the form twice. (the first time it does not get submitted the page just
reloads)

Is this a known issue? Can anyone tell me what is causing it and how to
rectify or fix it??

Any help would be greatly appreciated.

Here is the c# code for the page load and also the code for the submit
button:

private void Page_Load(object sender, System.EventArgs e)
{
if(Session["Complete"] == null || Session["Complete"].ToString()
!="complete")
{
Response.Redirect(NormUrl);
}

if(!Page.IsPostBack)
{

bttnContinue.ImageUrl = "Images/Bttn_Continu.gif";

ctrlAddress.PopulateDD();
ctrlAddress.PopulateY();
ctrlAddress.PopulateM();
ctrlAddress.PopulateT();
}
else
{
if(Session["_ViewState"] == null)
{
ctrlAddress.PopulateDD();
ctrlAddress.PopulateY();
ctrlAddress.PopulateM();
ctrlAddress.PopulateT();
}
}
}
private void bttnContinue_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
string str1Complete = "complete";

ClearErrors();

ctrlAddress.ReadFields();
ctrlAddress.ClearErrors();

bool bOk = ctrlAddress.ValidateFields();
bool bOk1 = ctrlAddress.ValidateAmountYears();
if(bOk == true && bOk1 == true)
{

ctrlAddress.CreateSessionVariables();

Session["1Complete"] = str1Complete;

Response.Redirect("2.aspx");

}

if(bOk == true && bOk1 == false)
{

ctrlAddressDetails.CreateSessionVariables();

Session["1Complete"] = str1Complete;

Response.Redirect("1a.aspx");

}

else
divOrderError.InnerHtml = "Blah.";
divOrderError2.InnerHtml = "blah.";

return;
}

Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Can anyone please help with this one??? Still very stuck on it... Thanks

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.