Disable ASP.NET Button after click to prevent the double click and change button text to Loading/Please Wait.
Design :
Code Behind :
}
Then check you result.
If you have any issue then let me know.
Design :
<asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" />
//Here javascript added to the button at page load.
protected void Page_Load(object sender, EventArgs
e)
{
try
{
string strProcessScript = "this.value='Processing...';this.disabled=true;";
Button1.Attributes.Add("onclick",
strProcessScript + ClientScript.GetPostBackEventReference(Button1, "").ToString());
}
catch { }
}
//After Button click method wait for 5 Second to check the result.
protected void
Button1_Click(object sender, EventArgs e)
{
Thread.Sleep(5000);
Then check you result.
If you have any issue then let me know.
No comments:
Post a Comment