I have my asp.net sub-master page setup like this:
<asp:Content ID="MainContent" runat="server" ContentPlaceHolderID="mainContent">
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html>
<head >
<title></title>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
...
</body>
</html>
</asp:Content>
Why does ASP.NET keep removing attribute that put in HEAD? Specifically, I am trying to make it like this:
<head runat="server">
If I do not have runat in HEAD, I receive the following error:
Using themed css files requires a header control on the page. (e.g. <head runat="server" />).
And here is my master master that load the sub-master page I have above:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Master.cs" Inherits="HeadOffice.Site" %>
<asp:contentplaceholder id="MainContent" runat="server">
</asp:contentplaceholder>
It turn out asp:Content is removing attribute from html, head, body. Not just head. Is there anyway to stop it?
Alright, the work around I found was that asp:content only modify your HTML if you fire off the onSave event. So what you do instad is make your edit, then don’t save, but close the VS2010 program, and click save on. This way, asp:content will not have a chance to modify your code. Afterward you can re-open the project.