martes, 11 de septiembre de 2012

Creating MessageBox using ASP.NET

private void ShowPopUpMsg(string msg)
{
StringBuilder sb = new StringBuilder();
sb.Append("alert('");
sb.Append(msg.Replace("\n", "\\n").Replace("\r", "").Replace("'", "\\'"));
sb.Append("');");
ClientScript.RegisterStartupScript(this.GetType(), "Aviso", sb.ToString(), true);
}