Click here to Skip to main content
11,575,925 members (57,960 online)
Click here to Skip to main content

Tagged as

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

, 8 Feb 2012 CPOL 30K 23
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. 2nd Best Mobile Article of January 2015
  2. 3rd Best Web Dev Article of May 2014
  3. 2nd Best Asp.Net article of MAY 2011
  4. 1st Best Asp.Net article of SEP 2010

Read More Articles...

You may also be interested in...

Comments and Discussions

 
QuestionClientScript not defined Pin
Ciupaz30-May-13 3:53
memberCiupaz30-May-13 3:53 
AnswerRe: ClientScript not defined Pin
Sunasara Imdadhusen22-Apr-14 4:06
professionalSunasara Imdadhusen22-Apr-14 4:06 
QuestionRequired Field and Custom validations present on page which are linked to button click. Pin
kaushalmehra11-Jan-13 0:48
memberkaushalmehra11-Jan-13 0:48 
AnswerRe: Required Field and Custom validations present on page which are linked to button click. Pin
Sunasara Imdadhusen22-Apr-14 4:06
professionalSunasara Imdadhusen22-Apr-14 4:06 
GeneralExcellent Pin
marvelusexpy15-Nov-12 2:10
membermarvelusexpy15-Nov-12 2:10 
GeneralRe: Excellent Pin
Sunasara Imdadhusen22-Apr-14 4:07
professionalSunasara Imdadhusen22-Apr-14 4:07 
GeneralMy vote of 5 Pin
Savalia Manoj M7-Nov-12 1:10
memberSavalia Manoj M7-Nov-12 1:10 
GeneralRe: My vote of 5 Pin
Sunasara Imdadhusen22-Apr-14 4:07
professionalSunasara Imdadhusen22-Apr-14 4:07 
GeneralRe: My vote of 5 Pin
Sunasara Imdadhusen22-Apr-14 4:08
professionalSunasara Imdadhusen22-Apr-14 4:08 
GeneralReason for my vote of 5 good one Pin
nikhi _singh27-Feb-12 18:46
membernikhi _singh27-Feb-12 18:46 
GeneralRe: Reason for my vote of 5good one Pin
Sunasara Imdadhusen22-Apr-14 4:09
professionalSunasara Imdadhusen22-Apr-14 4:09 
GeneralReason for my vote of 5 very useful Pin
CS14016-Feb-12 18:33
memberCS14016-Feb-12 18:33 
GeneralRe: Reason for my vote of 5very useful Pin
Sunasara Imdadhusen22-Apr-14 4:10
professionalSunasara Imdadhusen22-Apr-14 4:10 
GeneralReason for my vote of 1 gh,hl Pin
Member 782038428-Jun-11 21:30
memberMember 782038428-Jun-11 21:30 
Reason for my vote of 1
gh,hl
GeneralRe: Reason for my vote of 1gh,hl Pin
Sunasara Imdadhusen22-Apr-14 4:11
professionalSunasara Imdadhusen22-Apr-14 4:11 
Generalreally Excelent Pin
mc_fayed25-Apr-11 21:54
membermc_fayed25-Apr-11 21:54 
GeneralRe: really Excelent Pin
Sunasara Imdadhusen22-Apr-14 4:11
professionalSunasara Imdadhusen22-Apr-14 4:11 
GeneralExcellent tip! Pin
DrABELL24-Apr-11 13:09
memberDrABELL24-Apr-11 13:09 
GeneralRe: Excellent tip! Pin
Sunasara Imdadhusen22-Apr-14 4:11
professionalSunasara Imdadhusen22-Apr-14 4:11 
GeneralRe: Excellent tip! Pin
DrABELL22-Apr-14 9:02
professionalDrABELL22-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 | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 8 Feb 2012
Article Copyright 2011 by Sunasara Imdadhusen
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid