Tuesday 12 May 2015

How to show a alert box in ASP.NET by code behind?


Sometimes, you may need to show a message after a successful insertion of record or after some action...

So you can use the following code to show a alert box in ASP.NET:

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);


This will show an alert box with the message: Record Inserted Successfully

or you can also use the following:


ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Insert is successfull')", true);

No comments:

Post a Comment