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

  • Home
  • SEARCH
  • 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 149073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:04:17+00:00 2026-05-11T09:04:17+00:00

I am getting the following XHTML validation warning in my ASP.NET MVC master page:

  • 0

I am getting the following XHTML validation warning in my ASP.NET MVC master page:

Validation (XHTML 1.0 Transitional): Element ‘title’ occurs too few times.

The title tag for the master page is included in the ContentPlaceHolder in the head tag as shown in the code below. The title tag in the ContentPlaceHolder is not taken into account when performing the validation, and I do not want to just add another one in the head tag because then I will be left with two title tags.

<head>     <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />     <meta http-equiv='Content-Style-Type' content='text/css' />     <asp:ContentPlaceHolder ID='head' runat='server'>         <title></title>     </asp:ContentPlaceHolder> </head> 

One work around that I have found is to use the following technique in the head tag:

<% if (false) { %>     <title></title> <% } %> 

Is this the best practice to resolve this warning? I am not a huge fan of adding the excess code just to pass validation warnings but I will live with it if there is not a better alternative.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T09:04:17+00:00Added an answer on May 11, 2026 at 9:04 am

    Do this instead:

    <head>     <title><asp:ContentPlaceHolder ID='title' runat='server'>Default Page Title Here</asp:ContentPlaceHolder></title>     <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />     <meta http-equiv='Content-Style-Type' content='text/css' />     <asp:ContentPlaceHolder ID='head' runat='server'></asp:ContentPlaceHolder> </head> 

    Or as an alternate, set the title programattically from each page.

    What’s happening in your case is that when a new view is created, it creates empty content items which override the default content in the placeholders. If you remove the empty content blocks from the view, the default placeholder content will be used, but then you can’t set the contents from the view. Using the code above you can override a default title from each view and include scripts, etc. in the head independently of each other.

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

Sidebar

Related Questions

I am getting this message in my asp.net page. Any suggestions to resolve this
I am trying to validate my page and getting the following w3 validation error
I am getting this warning in Eclipse: NLS missing message: CANNOT_FIND_FACELET_TAGLIB in: org.eclipse.jst.jsf.core.validation.internal.facelet.messages ICEfacesPage1.xhtml
I have following 2 files as below: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
I'm having some trouble getting the following page to display properly in IE 7.
I have the following HTML: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html
Am getting following error message on calling WCF service: The formatter threw an exception
I am getting following error when I am trying to get WebResponse using WebResponse
I am getting Following Exception while configuring the Connection Pool in Tomcat This is
I am getting following error message when using Doctrine ORM in Codeigniter. ( !

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.