Double submit

  • Thread starter Thread starter Arne Garvander
  • Start date Start date
A

Arne Garvander

Where can I find a button that can only be submitted only once?
Does the Ajax controlkit have such a button ?
 
You could put any button in the Ajax update panel and it will do this. Or
in the Page_Load you could always throw in a if(Page.IsPostBack( { return; }
 
I tried
If IsPostBack Then
Return
End If
It did absolute nothing to prevent multiple submit.
Why would I think that the update panel trick would do anything?

--
Arne Garvander
Certified Geek
Professional Data Dude


Lucid said:
You could put any button in the Ajax update panel and it will do this. Or
in the Page_Load you could always throw in a if(Page.IsPostBack( { return; }
 
Where can I find a button that can only be submitted only once?
Does the Ajax controlkit have such a button ?

Other options:

- via javascript, attach an ONCLICK event that disables the button once
clicked.

- handle the problem server-side by checking to see if whatever executes on
click was already triggered int he past x seconds.

-Darrel
 
Thanks for the tip.
<script language="javascript">
function SingleSubmit()
{
document.getElementById('Button1').disabled = true;
return true;
}
</script>
<asp:Button ID="Button1" OnClientClick="return SingleSubmit()"
runat="server" Text="Button" />
--
Arne Garvander
Certified Geek
Professional Data Dude
 
Miss understood the question, thought he was talking about data being
submitted twice on a single button click. Theres always the code-behind
route in the onclick event. Just add a ButtonName.Enabled = False; when the
request was successfully sent.
 
You can't disable a button once the postback has begun and, if you disable
it first, the postback won't actually happen...

Hmm...you may be right. I know I've done this before. I think instead of
disabling it, I may have moved it off screen and replaced it with
'submitting form...' text or something.

I'll have to dig through some old code to find it...

-Darrel
 
Back
Top