Does Site.Master NEED to have a "TitleContent" ContentPlaceHolder? Can I get rid of it?
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?
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.