Alert Message from code behind in ASP.NET

Samirbhogayta
Posted by Samirbhogayta under ASP.NET category on | Points: 40 | Views : 994
public static void ShowAlertMessage(string error)
{
Page page = HttpContext.Current.Handler as Page;
if (page != null)
{
error = error.Replace("'", "\'");
ScriptManager.RegisterStartupScript(page, page.GetType(), "err_msg", "alert('" + error + "');", true);
}
}

Comments or Responses

Login to post response