Site.Master 是否需要有一个“TitleContent”?内容占位符?我可以摆脱它吗?
我们使用客户提供给我们的包装器,我们将所有内容注入其中。
我们的母版页目前看起来像这样:
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<%= (string)ViewData["WrapperTop"] %> // wrapper is split by a <ContentWell /> tag
<div>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</div>
<%= (string)ViewData["WrapperBottom"] %>
我遇到的问题是
是多余的,因为所有页面标题信息包含在客户端交付的包装器中。但是,当我尝试删除该行时,出现以下异常:
抛出了“System.Web.HttpUnhandledException”类型的异常。
有没有办法让我安全地摆脱它或 ASP.NET 执行此操作? NET MVC 需要它才能工作吗?
We use a wrapper that is delivered to us by our client, into which we inject all of our content.
Our master page currently looks like this:
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<%= (string)ViewData["WrapperTop"] %> // wrapper is split by a <ContentWell /> tag
<div>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</div>
<%= (string)ViewData["WrapperBottom"] %>
The issue I have with this is that
<asp:ContentPlaceHolder ID="TitleContent" runat="server" />
is redundant, because all of the page title information is contained in the wrapper that is delivered by the client. But when I try to delete that line I get the following exception:
Exception of type 'System.Web.HttpUnhandledException' was thrown.
Is there a way for me to safely get rid of that or does ASP.NET MVC need it to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不应该需要它——我有一个转换后的 1.0 应用程序,没有它,但它工作得很好。您是否确定在使用 Site.Master 的页面中删除了对它的任何引用?如果您已将其删除,那么这可能就是您的异常的来源。
You shouldn't need it -- I have a converted 1.0 app that doesn't have it and it works just fine. Have you made sure to remove any references to it in pages that use the Site.Master? That might be where your exception is coming from if you've removed it.