【发布时间】:2014-08-13 23:40:51
【问题描述】:
好的,所以,我来自 ASP 编程世界 - ASP.NET 有点新,我使用的是 Visual Studio 2013。
所以,当我只是想构建一个简单的表单时,我会收到此错误消息:
Server Error in '/' Application.
Stack empty.
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: Stack empty.
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: Stack empty.]
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +52
System.Collections.Generic.Stack`1.Pop() +6694385
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingRenderTraceListener.EndRendering(TextWriter writer, Object renderedObject) +85
System.Web.UI.RenderTraceListenerList.EndRendering(TextWriter writer, Object renderedObject) +58
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +142
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
这到底意味着什么?
当我在其周围放置<form> 标签时,页面似乎中断了:
<form id="form1" runat="server">
<asp:TextBox ID="post_feedback" runat="server" Height="100" Width="500" BackColor="#0066FF" Font-Bold="True" ForeColor="#FF9933" Wrap="False" TextMode="MultiLine" BorderColor="#000099" BorderStyle="Groove" BorderWidth="2"></asp:TextBox>
</form>
但是当我删除表单标签并“运行”它时,我没有那么长的堆栈错误。我什至还没有对 *.aspx.cs 文件做任何事情;没有进行函数调用,什么都没有。
那么这一切到底意味着什么?我真的迷路了。谢谢。
【问题讨论】:
-
(标题的选择确实会影响问题的接受度。)
-
您确定
form标签中的属性runat有效吗? -
很多反对将其搁置的人应该考虑先自己进行编辑。
标签: c# asp.net visual-studio webforms