65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.83/5 (3 votes)

Apr 25, 2011

CPOL
viewsIcon

10632

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);
        $(this).val("Processing...");
    });
OK, then any button you need to disable when submit, you just need to add class "DisableWhenClick" Enjoy!