473,394 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Page Reload After Back Button - Submit Form Twice

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
1 8446
Can anyone please help with this one??? Still very stuck on it... Thanks

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: | last post by:
When I complete a <FORM METHOD=POST> and I press <INPUT TYPE=SUBMIT> a new page was arrive. Then, if I press browser back button it says that: "page has expired". Why??? Can I fix it or it is...
4
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
6
by: iwearwatches | last post by:
Group, What a root canal. Here is what I have: I have a page that has several layers that I will either show/hide based on a graphic/tab that the user clicks. (works perfectly)
2
by: Frawls | last post by:
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.
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
9
by: Chris | last post by:
I pop up a Modal form on a web page that allows the user to update the selections of a dropdownlist via adding a new item to the db (Sql Server).The only thing is this list is on the page beneath...
7
by: Schmidty | last post by:
Okay...I have another 'newbie' question; I have a function that loads a page and the action is $_SERVER; In the form that is in a function(method?) within a class a variable is passed back to...
16
by: sreemati | last post by:
Hi everyone, This is the scenario: I have two button - Submit and Reset Submit is used for validation and after validation is passed it passes it to another form to enter into database. ...
1
by: =?Utf-8?B?QWxCcnVBbg==?= | last post by:
I have a form containing three AJAX UpdatePanels, two of which contain a pair of listboxes and a pair of buttons, with the third one containing a pair of radio buttons in a radiobutton list and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.