Friday, March 18, 2011

Script Alert From Code Behind

Add This Method In Your Aspx.cs Page and Call where You want to Alert

public void ScriptAlert(string Message)
{
string alertScript = "javascript: alert('" + Message + "')";
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertScript", alertScript, true);
}

Example:
ScriptAlert("Test");

No comments:

Post a Comment