Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
JavaScript coding question
Message
De
27/09/2006 14:45:44
 
 
À
27/09/2006 14:00:01
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01157580
Message ID:
01157606
Vues:
24
>Well, it's my turn to ask a question - i'm really stuck on something.
>
>I have a button on a web form, using ASP.NET 2.0. The button is a save button, where I have a C# method call in the code-behind.
>
>I need to disable the save button IMMEDIATELY when the user clicks it - I can't try to disable it in the code-behind, because the user can still click twice on it. So I'm guessing I need JavaScript.
>
>What confuses me is that I need the onclick event of the save button to run the javascript, as well as run my C# code-behind. Not quite sure of the syntax.
>
>I'm sure it's something simple,but I'm missing it. I'm going to do some google searches, but am also posting, in case anyone has run across this.

Can you set a flag in your code-behind, and branch your code so that second or subsequent clicks/calls don't do anything?

A SWAG: maybe the browser is queueing mouse clicks or ENTER key hits on that button. Still, that might not be the cause of the problem - if your code behind disables the button, once posted back the button will be disabled and any mouse/keyboard action applied to it should do nothing anyways.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform