在aspx文件里,System.Windows.Forms.MessageBox.Show("sss");可以这么用弹出框吗?刚才试了试,竟然可以。以前都是往前台注册一个js代码,例如response.write("<script>alert('sss');</script>");今天突然发现用System.Windows.Forms.MessageBox.Show("sss");这个也可以。有啥弊端吗?

解决方案 »

  1.   

    ”命名空间“System”中不存在类型或命名空间名称“Windows”(是缺少程序集引用吗?)”  我试怎么不行呀????
      

  2.   

    在aspx.cs里用System.Windows,会不会出问题呀?在b/s项目里用c/s模式里的弹出框,这不符合设计原理吗,不过竟然可以。咋以前没人关注过这个问题呀。
      

  3.   

     Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.Source Error:The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:this is what i got
      

  4.   

    在应用程序未以 UserInteractive 模式运行的情况下显示有模式对话框或窗体是无效的操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.InvalidOperationException: 在应用程序未以 UserInteractive 模式运行的情况下显示有模式对话框或窗体是无效的操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。
      

  5.   

    到一个没安.net framework 的client 打开试试。
    就或几个人同试登录,让弹出窗口返回一个变量试试。
      

  6.   

    到一个没安.net framework 的client 打开试试。 
    就或几个人同试登录,让弹出窗口返回一个变量试试。 
    ---------------------------------------------
    B/S结构实在服务器端执行得,你Client端没装有没关系,其实在做自定义控件时引用windows.From然后让他有弹出框的应用很多得,要挂ASP.Net做得东西Serverd端肯定要装framework