473,408 Members | 1,841 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,408 software developers and data experts.

Implicit calling of Submit button on Page Refresh.

Hi,

I have a login page, the problem I'm facing is like this;

1. Login page with submit button (being default button);

2. When first time the page is submitted then submit code is called.

3. Again when page refresh is done by (f5) then submit button is fired
implicitly.

Any thoughts are welcome

thanks..

Jun 27 '06 #1
1 2696
Ibrahim. wrote:
Hi,

I have a login page, the problem I'm facing is like this;

1. Login page with submit button (being default button);

2. When first time the page is submitted then submit code is called.

3. Again when page refresh is done by (f5) then submit button is fired
implicitly.

Any thoughts are welcome

thanks..


You have to make use of Page.IsPostback property. This property will
tell you whether the page refresh happens thru a Postback or normal refresh.

So, when you call the method that checks for the login should be called
similar to this,

if (Page.IsPostBack)
{
//Your Submit code goes here
}

But, in your case after a proper post-back call, if user hits f5 to
refresh the page, what happens internally is IE sends all the POST data
back to server since it maintains the current state of the page, so will
get it as a PostBack only. In my understanding, there is no straight
forward way to stop this, only one way i can suggest you is once the
user clicks on submit, do all the work related to the Click event and
redirect the page (may be a login successfull page in your case) to
someother page, so that even if user presses f5 it wont be a postback.

Let me know if you need further clarifications.

-
Vadivel Kumar
http://vadivelk.net
Jun 27 '06 #2

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

Similar topics

4
by: Noel Wood | last post by:
Hello, I have a problem that I'm sure is simple but I have searched the newsgroup and have not found it posted before so I apologize if it has been asked heaps of times before. I have a page that...
7
by: kindermaxiz | last post by:
I have a php script with a form that insert data in a mysql db and when I click on submit I would like the page to refresh after the insertion, how can I do that? it's a php script that display...
7
by: Julia Briggs | last post by:
Hello World - I admit I'm new to javascript but I've tried for days to find a solution to my problem. Basically I have 3 unique javascript files that do different screen display events that I...
5
by: Jerry Camel | last post by:
Trying to implement the following: Users is logging in They enter theire username and password and click a login button The page should then display an activity indicator (animated gif) and then...
0
by: jobs | last post by:
I have a page where users select from a bunch of gridviews, setting session variables and then hit an a New or Edit button which redirects them to a formview in edit or insert mode. While in...
11
by: gotonagle | last post by:
hi, can some help me in this regard i m entering some values in my databse from my asp page. for this i m using a submit button which submit the form to a new page that is 'insert.asp'. this page...
2
by: Carlos | last post by:
Hi all, I need to know how to prevent to repeat the operations that happen when the submit button is clicked, when the page is refreshed. I noticed that if I refresh my page after the submit...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
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...
0
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,...

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.