Disable ASP NET button after click to prevent double clicking

  Рет қаралды 57,164

kudvenkat

kudvenkat

Күн бұрын

Пікірлер: 37
@omniasoftns
@omniasoftns 8 жыл бұрын
The best teacher on the internet! what happens if the validator does not allow the execution of commands, remain stuck in disable mode.
@kentzurichanthonycalderon4457
@kentzurichanthonycalderon4457 2 ай бұрын
agree
@jaivirsingh8132
@jaivirsingh8132 9 жыл бұрын
Hi Venkat. You are doing a tremendous job to help millions. I tried to disable button to avoid double click using this trick. But its not working well if validations are applied on button. In case of client side validations, its continuously showing Please Wait... text. How to solve this problem?
@vivekkrishnan5764
@vivekkrishnan5764 9 жыл бұрын
Great post! It helped me to fix an issue for a similar change I did for disabling a button. The issue was that the button post back was not happening in Safari/Firefox browser, when I added onclientclick on button control. I followed the 2nd example shown in the video by adding it to the onclick event under page_load, and it worked beautifully! Another tip I would like to suggest is, append (if !(page_clientvalidate() {false}; to this.disabled = true, so that any client validations such as checking mandatory fields, character length etc will be triggered before the button is disabled.
@AbhilashThomas
@AbhilashThomas 9 жыл бұрын
Thank you for such good explanation, i was struggling without this last 3 months for a critical project.
@gabrielconstantinescu9725
@gabrielconstantinescu9725 3 жыл бұрын
Very good. Simple and elegant. I saw many ways of doing that but there were a lot more complicated than this.
@TewhideFirst
@TewhideFirst 8 жыл бұрын
Excellent work. very short very simple and practical.
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 8 жыл бұрын
+Sadat Kemal Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful. I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you kzbin.infoplaylists?view=1&sort=dd If you need DVDs or to download all the videos for offline viewing please visit www.pragimtech.com/kudvenkat_dvd.aspx Slides and Text Version of the videos can be found on my blog csharp-video-tutorials.blogspot.com Tips to effectively use my youtube channel. kzbin.info/www/bejne/r2ibYYCtnb5qZtU If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel. kzbin.info If you like these videos, please click on the THUMBS UP button below the video. May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them. Good Luck Venkat
@thethomasproject
@thethomasproject 6 жыл бұрын
Thanks for this. Only recommendation I'd make is to isolate the example from a full build.
@paritoshshah8361
@paritoshshah8361 4 жыл бұрын
Absolute master stroke.... save much time.... thank you very much..
@rameshvemula8728
@rameshvemula8728 8 жыл бұрын
Wonderful work, You solved my big headache.
@bolikdimon
@bolikdimon 8 жыл бұрын
Great post. But how to modify this behaviour in case if there are some validators on page? If first click triggers validation error then the button will be disabled for the second time. Thanks
@JediPhantom
@JediPhantom 9 жыл бұрын
fantastic, always wanted to know how to do this..thank you
@mahipalkamanchi
@mahipalkamanchi 9 жыл бұрын
thank u sir...! sir how to avoid duplicate entry to database from Data entry form when user press F5.
@madhusudansharma344
@madhusudansharma344 9 жыл бұрын
Hi Venkat, This doesn't work when you are using Validation controls. For an example if you will use requirefieldvalidator in the form and let it to validate the textbox. Your form will not be posted back but button will be disabled. Kindly guide me to handle that situation. Thanks in advance
@civranjan
@civranjan 6 жыл бұрын
I am using fileuploader and dropdown list to select data. After aubmiting file my server side control fluctuate. After using update panel and trigger . Please show some path
@HebaAmer2000
@HebaAmer2000 6 жыл бұрын
Excellent, thank you. But I cannot still make it work when there is validation on the page using RequiredFieldValidator
@jaivirsingh8132
@jaivirsingh8132 9 жыл бұрын
Hi Venkat, I put a question to you. Now I found the answer and sharing. function UpdateClick(btn) { for (i = 0; i < Page_Validators.length; i++) { ValidatorValidate(Page_Validators[i]); if (Page_Validators[i].isvalid == false) return false; } btn.disabled = 'false'; btn.value = 'Please Wait...'; return true; }
@madhusudansharma344
@madhusudansharma344 9 жыл бұрын
+Jaivir Singh does it work if you don't have any validation control on page?
@SandeshMRaghav
@SandeshMRaghav 3 жыл бұрын
UseSubmitBehavior="false" OnClientClick="if (!Page_ClientValidate()){ return false; }this.disabled='true'; this.value='Please wait..';"
@saramh6353
@saramh6353 6 жыл бұрын
Hello, I would like to thank you for the video. You prevent double clicking on the button to not insert into the database twice, but how about if we click on 'Enter', i think your code will not work ! If someone here know how can i do the same for the click on 'Enter' please share the code. Thank you
@ajithkts
@ajithkts 3 жыл бұрын
Thank you soooo much..........
@deepakpathak4801
@deepakpathak4801 4 жыл бұрын
Valuable trik thanks
@abhinavkumar8271
@abhinavkumar8271 8 жыл бұрын
Excellent one..
@ajaysinghbisht7476
@ajaysinghbisht7476 5 жыл бұрын
Which book is best for design Java script??
@FG-ol6ye
@FG-ol6ye 2 жыл бұрын
How can this be done on .net 6 with razor page? many thanks!
@divewithshubham
@divewithshubham 8 жыл бұрын
How to prevent button click getting fired twice?
@ABnSuItan
@ABnSuItan 8 жыл бұрын
thanks
@serkantepe47
@serkantepe47 7 жыл бұрын
Hello, why does the ScriptManager.RegisterStartupScript method not work in the safari browser?
@abhisheksutar1747
@abhisheksutar1747 6 жыл бұрын
this.disabled=true;this.value='Please wait' works fine but i have another javascript for required filed Validations for empty text box, when i use both script in onclick event, it stops working. Any Solution? (onclick="this.disabled=true;this.value='Please wait';return validate();")
@SandeshMRaghav
@SandeshMRaghav 3 жыл бұрын
UseSubmitBehavior="false" OnClientClick="if (!Page_ClientValidate()){ return false; }this.disabled='true'; this.value='Please wait..';"
@CheckTime
@CheckTime 9 жыл бұрын
Спасибо! Работает! :)
@pablosalas8586
@pablosalas8586 9 жыл бұрын
For some reason the image wait.png' does not appear :(
@magebharath1739
@magebharath1739 6 жыл бұрын
This is fails on when we validation how to fix ?
@fred51523
@fred51523 5 жыл бұрын
UseSubmitBehavior="false" OnClientClick="if (!Page_ClientValidate()){ return false; }this.disabled='true'; this.value='Please wait..';"
@pbrcss2008
@pbrcss2008 7 жыл бұрын
When I use UseSubmitBehavior="false" , then $("#btn_SaveAmount").click(function () { jQuery("#form1").validationEngine(); }); Not work, Please help to solve the issue... Thank you
RegisterStartupScript and RegisterClientScriptBlock methods
16:11
ASP NET control client id in JavaScript
12:13
kudvenkat
Рет қаралды 22 М.
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 36 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 3 МЛН
When mom gets home, but you're in rollerblades.
00:40
Daniel LaBelle
Рет қаралды 141 МЛН
How to Disable a Button after Clicking in Blazor
8:42
Claudio Bernasconi
Рет қаралды 1,7 М.
Command Event of an asp.net button control Part 15
15:42
kudvenkat
Рет қаралды 199 М.
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 81 М.
JavaScript to select all checkboxes in GridView
25:29
kudvenkat
Рет қаралды 39 М.
Understand C# LAMBDA Expressions in only 2 minutes!
4:22
tutorialsEU - C#
Рет қаралды 59 М.
UseSubmitBehavior property of the Button control   Part 39
9:40
Stop Using FirstOrDefault in .NET! | Code Cop #021
12:54
Nick Chapsas
Рет қаралды 91 М.
JavaScript confirm on gridview delete
11:20
kudvenkat
Рет қаралды 51 М.
For loop in JavaScript
10:02
kudvenkat
Рет қаралды 62 М.
62. .NET Framework vs .NET Core vs .NET vs .NET Standard vs C#
25:14
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 36 МЛН