Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

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

, 8 Feb 2012
Rate this:
Please Sign up or sign in to vote.
Disable button after click and display text [Processing...]
Add the following lines on .aspx page:
<asp:Button ID="btnProcess" runat="server" onclick="btnProcess_Click"
            Text="Process" />
 
Add the following line on .aspx.cs page (Page_Load).
string strProcessScript = "this.value='Processing...';this.disabled=true;";
        btnProcess.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btnProcess, "").ToString());
 
This will disable Button, and then change the text of the button "Processing...", and then continue on with the server side event btnProcess_OnClick event handler.
 
Thanks,
Imdadhusen

License

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

Share

About the Author

Sunasara Imdadhusen
Software Developer (Senior) Infostretch Ahmedabad-Gujarat
India India
Aspiring for a challenging carrier wherein I can learn, grow, expand and share my existing knowledge in meaningful and coherent way.

sunaSaRa Imdadhusen
 
AWARDS:
  1. 1st Best Asp.Net article of SEP 2010
  2. 2nd Best Asp.Net article of MAY 2011
 
Read More Articles...
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
QuestionClientScript not defined PinmemberCiupaz30-May-13 3:53 
AnswerRe: ClientScript not defined PinprofessionalSunasara Imdadhusen22-Apr-14 4:06 
QuestionRequired Field and Custom validations present on page which are linked to button click. Pinmemberkaushalmehra11-Jan-13 0:48 
AnswerRe: Required Field and Custom validations present on page which are linked to button click. PinprofessionalSunasara Imdadhusen22-Apr-14 4:06 
GeneralExcellent Pinmembermarvelusexpy15-Nov-12 2:10 
GeneralRe: Excellent PinprofessionalSunasara Imdadhusen22-Apr-14 4:07 
GeneralMy vote of 5 PinmemberSavalia Manoj M7-Nov-12 1:10 
GeneralRe: My vote of 5 PinprofessionalSunasara Imdadhusen22-Apr-14 4:07 
GeneralRe: My vote of 5 PinprofessionalSunasara Imdadhusen22-Apr-14 4:08 
GeneralReason for my vote of 5 good one Pinmembernikhi _singh27-Feb-12 18:46 
GeneralRe: Reason for my vote of 5good one PinprofessionalSunasara Imdadhusen22-Apr-14 4:09 
GeneralReason for my vote of 5 very useful PinmemberCS14016-Feb-12 18:33 
GeneralRe: Reason for my vote of 5very useful PinprofessionalSunasara Imdadhusen22-Apr-14 4:10 
GeneralReason for my vote of 1 gh,hl PinmemberMember 782038428-Jun-11 21:30 
GeneralRe: Reason for my vote of 1gh,hl PinprofessionalSunasara Imdadhusen22-Apr-14 4:11 
Generalreally Excelent Pinmembermc_fayed25-Apr-11 21:54 
GeneralRe: really Excelent PinprofessionalSunasara Imdadhusen22-Apr-14 4:11 
GeneralExcellent tip! PinmemberDrABELL24-Apr-11 13:09 
GeneralRe: Excellent tip! PinprofessionalSunasara Imdadhusen22-Apr-14 4:11 
GeneralRe: Excellent tip! PinprofessionalDrABELL22-Apr-14 9:02 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 8 Feb 2012
Article Copyright 2011 by Sunasara Imdadhusen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid