public void AlertMsg(string msg, bool async) { string script = string.Format("alert('{0}'); ", msg); RegisterClientScript(script, async);
public void RegisterClientScript(string script, bool async) { if (async) { System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(), script, true); } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), script, true); } }