编辑Asp.Net用户控件标记后分析错误
我有一个asp.net webforms.net 4.0,Visual Studio 2013用户控件,它现在运行得非常好。它使用asp标签控件和资源标记根据当前用户的语言/区域性设置引入文本 我需要添加一些文字 但是,添加新的asp标签会自动创建解析错误。一旦出现错误,我就不能删除标签。我必须将标记和设计器代码恢复到上次提交时的状态。在我看来,设计器代码中一定有东西被破坏了,但我不知道从哪里开始寻找 下面是解析错误:编辑Asp.Net用户控件标记后分析错误,asp.net,webforms,Asp.net,Webforms,我有一个asp.net webforms.net 4.0,Visual Studio 2013用户控件,它现在运行得非常好。它使用asp标签控件和资源标记根据当前用户的语言/区域性设置引入文本 我需要添加一些文字 但是,添加新的asp标签会自动创建解析错误。一旦出现错误,我就不能删除标签。我必须将标记和设计器代码恢复到上次提交时的状态。在我看来,设计器代码中一定有东西被破坏了,但我不知道从哪里开始寻找 下面是解析错误: Description: An error occurred during
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'OnlineRegistration.Confirmation'.
Source Error:
Line 1:
Line 2: <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Confirmation.ascx.vb" Inherits="OnlineRegistration.Confirmation" %>
Line 3:
Line 4: <asp:Label
Source File: /WebPages/ConfirmationUCTL/Confirmation.ascx Line: 2
下面是用户控件的标记
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Confirmation.ascx.vb" Inherits="OnlineRegistration.Confirmation" %>
<asp:Label
ID="litConfirmation"
runat="server"
meta:resourcekey="litConfirmationResource1"/>
<p>
<asp:Label
ID="litConfirmationThankYou"
runat="server"
meta:resourcekey="litConfirmationThankYouResource1"/>
<strong> 
<asp:Label
ID="litConfirmationNumber"
runat="server"
meta:resourcekey="litConfirmationNumberResource1"/>
</strong>. 
<asp:Label
ID="litConfirmationProcessing"
runat="server"
meta:resourcekey="litConfirmationProcessingResource1"/>
</p>
<asp:Label ID="Label1" runat="server" Text="Label" />
<p>
<asp:Label
ID="litConfirmationVNC"
runat="server"
meta:resourcekey="litConfirmationVNCResource1"/>
</p>
<p>
<asp:Label
ID="litConfirmationQuestions"
runat="server"
meta:resourcekey="litConfirmationQuestionsResource1"/>
</p>
<p>
<asp:Label
ID="litErrorSaving"
runat="server"
meta:resourcekey="litErrorSavingResource1"
CssClass="hide"/>
</p>
<asp:HyperLink
ID="linkPrintVRA"
runat="server"
meta:resourcekey="linkPrintVRAResource1"
CssClass="hide"/>
我所做的就是添加以下内容:
<asp:Label ID="Label1" runat="server" Text="Label" />
然后编译并运行。此时会出现解析错误
知道从哪里开始查找这个bug吗?我仍然不知道为什么会发生这种情况。但我同意这样的理论,即designer.vb文件不知何故已损坏 因此,我将标记和代码隐藏文件的内容复制到一个文本文件中 然后我从项目中删除了整个用户控件,并保存和清理了应用程序 然后我重新添加了用户控件并保存了它 最后,我将标记和代码的内容复制回用户控件,并保存和编译
现在,将新控件添加到标记工作正常。检查此项,感谢链接。但是这在我的开发箱上,我已经检查了所有的参考资料。所以它似乎不合适。我看到了使用CodeFile而不是CodeBehind的建议,并且还清除了bin文件夹。你需要尝试一些事情,这似乎是一个错误,我已经清除了bin文件。但是CodeFile不是一个选项,因为它不是预编译代码,因此不是服务器上的源文件站点。这违反了我们的安全政策。