调试网站出错
在调试网站时,凡是和数据库相关的按钮,总是打不开下一个界面,总是出现相同的错误界面,代码粘贴如下。请高手们帮忙给看看啊。Server Error in '/test' Application.
--------------------------------------------------------------------------------
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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[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.]
System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp) +3188402
System.Windows.Forms.MessageBox.Show(String text) +40
WebVote.AdminMain.ButtonCreatNewVote_Click(Object sender, EventArgs e) in D:\网站设计实现\MY\WebVote\WebVote\AdminMain.aspx.cs:31
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5019
--------------------编程问答-------------------- D:\网站设计实现\MY\WebVote\WebVote\AdminMain.aspx.cs:31
出错的地方都给你了
AdminMain.aspx.cs文件的第31行代码有问题,请修改。 --------------------编程问答-------------------- 重启下你的机器。试试! 还有IIS! 检查config文件! --------------------编程问答--------------------
+1 --------------------编程问答-------------------- 确保编译通过 本地测试通过了再在服务器上面部署
补充:.NET技术 , ASP.NET