4
我有一個使用主文件的Web窗體。<meta><asp:ContentPlaceholder>中的標記會生成解析器異常
我想有一些meta標籤,以默認設置,但可重寫的子文件
我設置了Main.Master文件看起來像這樣:
<head runat="server">
<asp:ContentPlaceHolder ID="pgTitle" runat="server">
<meta id="mtaPgTitle" runat="server" class="pgTitle" content="DefaultTitle"/>
</asp:ContentPlaceHolder>
這會在Main.Master.designer.cs文件看起來像這樣
protected global::System.Web.UI.HtmlControls.HtmlMeta mtaPgTitle;
不過線,當我嘗試運行它,我得到一個分析器錯誤與消息
The base class includes the field 'mtaPgTitle', but its type (System.Web.UI.HtmlControls.HtmlMeta) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).
我們剛剛從VS2008升級到VS2010。有沒有辦法解決這個手動梳理設計器文件以將類型還原爲HtmlGenericControl?我已經嘗試給各種加載事件添加一個修復程序,但解析器錯誤似乎發生在任何加載事件之前。