473,513 Members | 6,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

button_click fired by F5

Hi all,
I've a server button handling a button_click procedure.
If the client user clicks the button, the page causes the postback and
the
button_click procedure is fired.
Then, if the user press F5 (refresh page), the button_click procedure
is
fired again.
Someone knows how to workaround this problem, or where I'm going wrong?

Thank you in advance!
Regards

Gaddoz

Nov 19 '05 #1
9 1929
<ga********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Someone knows how to workaround this problem


What problem? This is totally normal behaviour.
Nov 19 '05 #2
I'm a little confused!
I need to call the procedure only when the user clicks the button,
not when refreshes the page, also if the user clicked the button one
time before...

Nov 19 '05 #3
I don't know if you can block it. You can try to block f5 key in javascript,
but I'm not sure about that.
Nov 19 '05 #4
I don't want block the refresh!
I need to fire some procedure only when the user clicks the button.

Nov 19 '05 #5
<ga********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I'm a little confused!
I need to call the procedure only when the user clicks the button,
not when refreshes the page, also if the user clicked the button one
time before...


What do you think the Refresh button does?

It instructs the webserver to re-execute the most recent page load in
exactly the same way as it was loaded the last time, so if the last load was
as a result of clicking a button, that's exactly what the Refresh button
will try to do...
Nov 19 '05 #6
I was thinking that refresh instructs the browser to recall the page!
And I was thinking that is the asp.NET statewiev to tell that there was
a button a click.
Isn't it??

Nov 19 '05 #7
F5/Refresh would just repeat the last action. This behaviour is by default..
there are several article on work arounds for this..

This is a popular MSDN article mentioning trapping the refresh

http://msdn.microsoft.com/library/de...rockASPNET.asp

Google "stop refresh asp.net" for more..

HTH
"ga********@gmail.com" wrote:
Hi all,
I've a server button handling a button_click procedure.
If the client user clicks the button, the page causes the postback and
the
button_click procedure is fired.
Then, if the user press F5 (refresh page), the button_click procedure
is
fired again.
Someone knows how to workaround this problem, or where I'm going wrong?

Thank you in advance!
Regards

Gaddoz

Nov 19 '05 #8
The workaround is to add a inputhidden field with javascript that'll clear
it onload. And then set it to some value before submit.

So on your codebehind, you can tell the difference. :)

<ga********@gmail.com>
???????:11*********************@g14g2000cwa.google groups.com...
Hi all,
I've a server button handling a button_click procedure.
If the client user clicks the button, the page causes the postback and
the
button_click procedure is fired.
Then, if the user press F5 (refresh page), the button_click procedure
is
fired again.
Someone knows how to workaround this problem, or where I'm going wrong?

Thank you in advance!
Regards

Gaddoz

Nov 19 '05 #9
Sorry, it won't work. I've get the idea wrong. The postback inited this way
seems to neglect the current input field values... :(

"Lau Lei Cheong" <le****@yehoo.com.hk> ¼¶¼g©ó¶l¥ó·s»D:O0**************@TK2MSFTNGP15.phx.g bl...
The workaround is to add a inputhidden field with javascript that'll clear
it onload. And then set it to some value before submit.

So on your codebehind, you can tell the difference. :)

<ga********@gmail.com>
???????:11*********************@g14g2000cwa.google groups.com...
Hi all,
I've a server button handling a button_click procedure.
If the client user clicks the button, the page causes the postback and
the
button_click procedure is fired.
Then, if the user press F5 (refresh page), the button_click procedure
is
fired again.
Someone knows how to workaround this problem, or where I'm going wrong?

Thank you in advance!
Regards

Gaddoz


Nov 19 '05 #10

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

Similar topics

1
1411
by: Paul Aspinall | last post by:
Hi I have a form with a button on it. It seems that when I click the button, it causes Form_load to fire, before the Button_Click procedure Does anyone know why?? Thanks
3
2549
by: Tim Thomas | last post by:
Hi, I am very new to .NET and am in the process of building my first web application. I will briefly describe what i am trying to achieve: I have a system where suppliers register their...
2
2525
by: Frank Schumacher | last post by:
Hi Folks, I have a problem with the order of events fired by ASP.NET. I found many articles which explaining the lifecycle of a site, but I found none which took the event from a Control on the...
3
2460
by: I am Sam | last post by:
Please help. I'm dying here and pulling out the last few remaining elements of my hair over this. I have built a form that will identify and authenticate users. I keep getting the following...
13
1961
by: Matt | last post by:
I am trying to call a recursive subroutine within a Button_Click event. How can I do this? I tried to create a seperate Function() but it will not allow me to use any variables that I created in...
1
1956
by: Pushpadant Kacha via .NET 247 | last post by:
hi, I have an application where i am using a textbox and a submitbutton. the autopostback property of the textbox is set to true. now if there is a change in the textbox then thetexbox_changetext...
3
1411
by: charles | last post by:
Hi: In my page I need to re-start a thread. I put the code into a Button_Click(sender, e) handler. When I click the button, it works. Then I call this handler inside a timer's handler...
0
1881
by: John | last post by:
I am loading my controls dynamically into my asp.net page. When I click on a button on one of those user controls then page reloads and I need to reload the page based on what has happened in the...
8
2622
by: Marine | last post by:
Hi, Sorry i'm a newbie with Asp.net, here is my problem : private void Page_Load(object sender, System.EventArgs e) { if (IsPostBack) { Label1.Text = (string)Session; } } private void...
0
7254
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
7153
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...
0
7432
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...
1
5079
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...
0
4743
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...
0
3230
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
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 ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.