web page 中不支持MessageBox.Show() !!!

解决方案 »

  1.   

    Response.Write("<script>alert(\"消息\");</script>");
      

  2.   

    有吧?
    ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemwindowsformsmessageboxclasstopic.htm
      

  3.   

    JavaScript中有个Alert()可用,但在字符串中如果有"'"会报错!
      

  4.   

    可是,我只想要弹出框啊,不用javascript的可以么?
      

  5.   

    你看看MssageBox类下面的要求:
    要求
    命名空间: System.Windows.Forms
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family程序集: System.Windows.Forms (在 System.Windows.Forms.dll 中)
      

  6.   

    可以实现using System.Windows.Forms;MessageBox.Show ("The ","提示",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);
      

  7.   

    简单的说System.Windows.Forms名字空间的方法不能在web应用程序中使用,一般它只能用于windows桌面程序。而且,由于服务器端的代码是在服务器端执行,不可能在客户端弹出消息框。要弹出消息框必须用客户端程序,比如javascript。
    另外,从效率上讲,客户端代码要远远快于服务器端代码,因为它不需要与服务器端交互。
      

  8.   

    using System.Windows.Forms;MessageBox.Show ("The ","提示",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1,MessageBoxOptions.ServiceNotification);忘记说了,客户端要装框架……你可以试试把 System.Windows.Forms  的“是否复制到本地”属性设置为“Yes”;
      

  9.   

    MessageBox一般用于WinForm,在WebForm中可以象楼上的兄弟那么干,但在发布时有些麻烦,建议还是用Jscript中的Alter好些。