Disable an ASP.NET Button Control During Postback with an AJAX Loading Background Image
page 4 of 7
by Bryian Tan
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 49809/ 154


·         08/14/2009 - I found out that, in Firefox, if we hit the button and continue to the next page, and then hit the Back button (or javascript:history(-1);)... the button control is still disabled. I have updated the JavaScript (JScript2). I have not fully tested the new implementation. Please leave me a feedback and share your thoughts.

·         10/19/2009 - Modified the JavaScript(JScript2) to fix the double validation problem.


View Entire Article

User Comments

Title: nor   
Name: L;JL;KJ
Date: 2012-08-29 12:14:11 AM
Title: gdfg   
Name: dgdfgd
Date: 2012-04-29 4:19:49 AM
Title: Very nice tutorial   
Name: Janou M
Date: 2010-11-17 3:17:21 AM
Thanks for some great code and a good, clear explanation on how to use it. This function works perfectly. If I can now just get a good GIF image that spans across my submit button .. hehehe .. it's quite long in width.
Title: Mr   
Name: Sanaj M Shaji
Date: 2010-07-01 4:21:11 PM
Thanks a lot, you saved my 2 days work.
Title: Disable button while postback   
Name: Bryian Tan
Date: 2010-01-17 2:40:58 PM

I haven't try that yet, I'll let you know once I get it to work.

Praveen ,
Nice. Initially, I was using one of the solution you mentioned in your blog. But I wanted it to work with/without the present of validation control, image button, compatible with Firefox, and display background image. And I have encapsulated all the solutions in one JavaScript.

Bryian Tan
Title: Disable button while postback   
Name: Praveen
Date: 2010-01-17 5:28:27 AM
A simple solution for it is explained here. Which actually looks for the validation on server side and raise event when once the event raised. So, user can't do or send multiple request when one request is processing.
Title: Can we use it for delete button?   
Name: Jeff
Date: 2009-12-06 2:05:07 PM
Hi, i have use it and it work for regular button.

but i would like to implement it into my delete buttons which required a a javascript confirm validation first. But i try something and there is no postback when i click 'yes'.

you guys have done it?
Title: A production tested alternative   
Name: sjb101
Date: 2009-11-25 4:01:10 AM
I have used the following alternative on multiple production sites and it is an active part of my app templates now
Title: Disable Button   
Name: Servesh
Date: 2009-11-24 11:48:03 PM
It's working fine... and can be used for bulk upload

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2020 ASPAlliance.com  |  Page Processed at 2020-06-03 2:18:10 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search