To show Processing... after button click


In a form , if you want to show processing word or some other word while processing,when a button is clicked,then here are the steps to do so.It will helpful.you just have to add code in event handler in the code behind file of the page which contains the form.

In a form if you want to show processing word or some other word while processing,when a button is clicked,then here are the steps to do so.It will helpful. You just have to add code in event handler in the code behind file of the page which contains the form.Follow these steps:-

1. Add a button with its event handler "btnSubmit_Click" on onClick event,like mentioned below:


<asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" Text="Process" />


2. Add following code in code behind file in the Event handler "btnSubmit_Click" against button's Event onClick:

string processingScript = "this.value='Processing...';this.disabled=true;";
btnSubmit.Attributes.Add("onclick", processingScript + ClientScript.GetPostBackEventReference(btnSubmit, "").ToString());


3.The code will disable the Button when it is clicked, and then change the text of the button into the text "Processing...", and then continue on with further processing defined in the handler.


Comments

Author: sara05 Jun 2011 Member Level: Silver   Points : 0

Hi,
Hi,
Its work,any one who is new can easily do this and get success for it.Its a way to display Processing... without using Ajax or java script.It's a way to display it with help of C#.It also shows a way to write JavaScript via C#.

regards

Sara

Author: sara05 Jun 2011 Member Level: Silver   Points : 0

hi Just ch4ecking for eror

Author: Shareenah13 Jun 2011 Member Level: Bronze   Points : 0

Hi!

its work and solve my one problem.

Regards

Shareenah



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: