public class MessageBox
{
// private static Hashtable m_executingPages = new Hashtable();
private MessageBox() { }
public static void Show(string strMessage)
{
Page currentPage = HttpContext.Current.Handler as Page;
if (currentPage != null)
{
currentPage.ClientScript.RegisterStartupScript(
typeof(System.String),
"messagebox",
string.Format("alert(\"{0}\");", strMessage.Replace("\r\n", " ")),
true
);
}
}
}