Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8148869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:43:50+00:00 2026-06-06T14:43:50+00:00

I have my asp.net sub-master page setup like this: <asp:Content ID=MainContent runat=server ContentPlaceHolderID=mainContent> <!doctype

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:43:52+00:00Added an answer on June 6, 2026 at 2:43 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this serious: I have ASP.NET page, This page contents Update panel with
TGIF, I have a website I'm developing which is using ASP.NET masterpage/sitemap/content pages setup.
I have code in my ASP.NET master Page_Init event page that checks if a
I have created an asp.net MVC application.I created a asp:menu in the master page
I have a Master Page with nested pages in ASP.NET. Fairly simply I want
I have created a vertical menu on a ASP.NET master page using jQuery. Here
I have asp.net TextBox with ontextchanged event this is search text box in my
I have ASP.NET page with an iframe on it for displaying some pdf reports
I have ASP.NET page, it calls webservice via $.ajax and returns result in json
I have asp.net Menu Item <asp:MenuItem NavigateUrl= Text=Download Value=Download/> . When this item gets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.