【发布时间】:2014-05-30 21:34:51
【问题描述】:
我有一个 asp.net webforms(.Net 4.0,Visual Studio 2013)用户控件,现在可以完美运行。它使用 asp 标签控件和资源标签来根据当前用户的语言/文化设置引入文本。
我需要添加一些文字。
但是,添加新的 asp 标签会自动产生解析错误。一旦出现错误,我不能只删除标签。我必须将我的标记和设计器代码恢复到我上次提交的状态。在我看来,设计器代码中一定有一些东西被破坏了,但我不知道从哪里开始寻找。
下面是解析错误:
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" />
然后编译运行。并出现解析错误。
知道从哪里开始寻找这个错误吗?
【问题讨论】:
-
感谢您的链接。但这是在我的开发箱上,我已经检查了所有参考资料。所以它似乎不适合。
-
我看到了使用 CodeFile 而不是 CodeBehind 的建议,并且还清除了 bin 文件夹。您需要尝试一些事情,这似乎是一个错误
-
我已经清除了 bin 文件。但是 CodeFile 不是一个选项,因为它不是预编译代码,因此不是服务器上的源文件站点。这违反了我们的安全政策。