Serverside alert control
string javaScript = "<script language=JavaScript>\n" + "alert(' Data has been added successfully '); location = 'Home.aspx';\n" + "</script>";
ClientScript.RegisterStartupScript(typeof(Page), "btnSave_Click", javaScript);
With UpdatePanel Serverside alert control
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "alert(' Data has been added successfully'); window.location ='Home.aspx';", true);
string javaScript = "<script language=JavaScript>\n" + "alert(' Data has been added successfully '); location = 'Home.aspx';\n" + "</script>";
ClientScript.RegisterStartupScript(typeof(Page), "btnSave_Click", javaScript);
With UpdatePanel Serverside alert control
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "alert(' Data has been added successfully'); window.location ='Home.aspx';", true);
No comments:
Post a Comment