473,804 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(objec t sender, System.EventArg s e)
{
if(Session["Complete"] == null || Session["Complete"].ToString()
!="complete")
{
Response.Redire ct(NormUrl);
}

if(!Page.IsPost Back)
{

bttnContinue.Im ageUrl = "Images/Bttn_Continu.gi f";

ctrlAddress.Pop ulateDD();
ctrlAddress.Pop ulateY();
ctrlAddress.Pop ulateM();
ctrlAddress.Pop ulateT();
}
else
{
if(Session["_ViewState "] == null)
{
ctrlAddress.Pop ulateDD();
ctrlAddress.Pop ulateY();
ctrlAddress.Pop ulateM();
ctrlAddress.Pop ulateT();
}
}
}
private void bttnContinue_Cl ick(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
string str1Complete = "complete";

ClearErrors();

ctrlAddress.Rea dFields();
ctrlAddress.Cle arErrors();

bool bOk = ctrlAddress.Val idateFields();
bool bOk1 = ctrlAddress.Val idateAmountYear s();
if(bOk == true && bOk1 == true)
{

ctrlAddress.Cre ateSessionVaria bles();

Session["1Complete"] = str1Complete;

Response.Redire ct("2.aspx");

}

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

ctrlAddressDeta ils.CreateSessi onVariables();

Session["1Complete"] = str1Complete;

Response.Redire ct("1a.aspx");

}

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

return;
}

Nov 17 '05 #1
1 8466
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
4650
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 client side? I use <input tupe=submit> instead of links because it goes with my page style.
4
2343
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 need to: 1. Click a submit button on an asp page, calling another page that saves the contents of that form to a database and then displays
6
3991
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
3845
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
2589
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 courses are populated. When course is selected, lists of occurrences, groups and
9
1822
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 it. So when the user updates the db with a new selection, and then closes the form, the page below must be refreshed to see the new option. Any ideas on adding the new option to the control below the modal form? thanx.
7
3575
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 a mysqli connection and database and updates the database. The problem is that when the page is reloaded it does not show the updated information in the database with the $_SERVER. Why is the page loaded with the same information? Is it cached...
16
16698
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. Bascially the reset works fine if I use it before using the submit button in the form. For instance,if on submit there is some error as the values have not passed a validation. There is a error pop up message shown and the values are retained in...
1
1406
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 either three CascadingDropDown lists or two CascadingDropDown lists and a textbox depending on which radio button is selected. The only other control on my form is a button to submit the information on the form to the server. One thing I've...
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9166
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.