button_click fired by F5

  • Thread starter Thread starter gaddoznntp
  • Start date Start date
G

gaddoznntp

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
 
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...
 
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.
 
I don't want block the refresh!
I need to fire some procedure only when the user clicks the button.
 
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...
 
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??
 
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. :)
 
Sorry, it won't work. I've get the idea wrong. The postback inited this way
seems to neglect the current input field values... :(
 
Back
Top