Click here to Skip to main content
12,897,945 members (81,838 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 25 Apr 2011

Disable button after click and display text [Processing...]

, 25 Apr 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Good, my solution is by using Client Javascript.aspx pagescript //by using jqueryfunction DocumentReady() { //Button disable...
Good, my solution is by using Client Javascript

.aspx page
<asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn DisableWhenClick"
                    CommandName="Save" OnClick="btnAction_Click" />

script //by using jquery
function DocumentReady() {
    //Button disable when Click
    $(".DisableWhenClick").click(function() {
        $(this).attr("disabled", true);

OK, then any button you need to disable when submit, you just need to add class "DisableWhenClick"



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

China China
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralReason for my vote of 2 Disables other functionality; that i... Pin
SteveSM27-May-11 12:25
memberSteveSM27-May-11 12:25 
GeneralThis alternative seems to disable the OnClick event. Pin
SteveSM25-May-11 16:32
memberSteveSM25-May-11 16:32 
GeneralGood one! Pin
Sunasara Imdadhusen2-May-11 22:54
memberSunasara Imdadhusen2-May-11 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 25 Apr 2011
Article Copyright 2011 by duluohua
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid