vb.net编asp.net web application,用msgbox时,出错: 
在应用程序未以 UserInteractive 模式运行的情况下显示有模式对话框或窗体是无效的操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。  那么应该怎么设ServiceNotification 或DefaultDesktopOnly ,怎么用语句写呢? 另外,尝试用 Response.Write("<Script language='VBScript'>Msgbox('先生,您好!')</script>"),怎么老说语法错呢 最后问一下:怎么asp.net web application编程下,messagebox它不认,老说未声明呢 

解决方案 »

  1.   

    <script language=javascript>
       alert("MessageBox");
    </script>
      

  2.   

    Response.Write("<Script language='VBScript'>Msgbox(\"先生,您好!\")</script>");
      

  3.   

    Response.Write("<script language='javascript'>alert('登录成功!');</script>")
      

  4.   

    用楼上的方法。
    javascript可以在ie和网景中运行,但vbscript在网景中不支持。
      

  5.   

    vivianfdlpw() 的Response.Write("<Script language='VBScript'>Msgbox(\"先生,您好!\")</script>");
    编辑器认为"先生,您好!"是变量,说“未声明”!
      

  6.   

    我这边测试正常亚
    Response.Write("<Script language='VBScript'>Msgbox(\"先生,您好!\")</script>");
      

  7.   

    对于1,3,搂主应该弄清楚winform和webform的区别
      

  8.   

    在webform中最好用javascript,支持很多浏览器。
    Response.Write("<script language='javascript'>alert('登录成功!');</script>");
      

  9.   

    你是想在客户端显示一个对话框吧?但是vb.net的程序是在服务器端运行的,你直接用msgbox当然是显示不出对话框了。
      

  10.   

    WebForm中用不了WinForm中的MessageBox
    一般用Js配合实现客户端功能。