scriptclient输出类

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
                              );
        }
    }
}

原文地址:https://www.cnblogs.com/hateyoucode/p/1361061.html