将表单标记添加到ASP.Net Webforms页面时出现空堆栈错误

use*_*848 2 c# asp.net webforms visual-studio

好的,所以,我来自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
Run Code Online (Sandbox Code Playgroud)

这一切在世界上意味着什么?

当我在<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>
Run Code Online (Sandbox Code Playgroud)

但是当我删除表单标签并"运行"它时,我没有那么长的堆栈错误.我还没有对*.aspx.cs文件做过任何事情; 没有函数调用,没有.

那么这个世界究竟意味着什么呢?我真的迷路了.谢谢.

Joe*_*orn 6

在ASP.Net中,除非您小心指定没有WebForms的MVC站点,否则有一个True Form TM.您不会将自己的表单标记添加到页面.您可以使用Visual Studio帮助您为该页面放入的一个表单处理从回发创建的事件.