Double submit

A

Arne Garvander

Where can I find a button that can only be submitted only once?
Does the Ajax controlkit have such a button ?
 
L

Lucid

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; }
 
A

Arne Garvander

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; }
 
D

darrel

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
 
A

Arne Garvander

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
 
L

Lucid

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.
 
D

darrel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,937
Members
47,481
Latest member
ElviraDoug

Latest Threads

Top