Display Please Wait While the Page Refreshes

While uploading large files, it is nice to have a “Please wait…” text displaying on the button. You can simple achive this using ClientScript.GetPostBackEventReference method.

this.uxUpload.Attributes.Add("onclick", "this.value='Uploading... please wait'; this.disabled=true;" + ClientScript.GetPostBackEventReference(this.uxUpload,""));

The GetPostBackEventReference injects the __doPostBack method and also the hidden fields that hold the event target and event arguments.

This is a useful technique when uploading large files and during the process disabling the button control. 

MSDN : ClientScriptManager.GetPostBackEventReference Method

No related content found.

This entry was posted in .Net, Javascript. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>