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 180505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:35:54+00:00 2026-05-11T14:35:54+00:00

I am using the MVC to add a title to the masterpage with a

  • 0

I am using the MVC to add a title to the masterpage with a content place holder. The default MVC masterpage template uses the following code:

<head runat='server'> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <title><asp:ContentPlaceHolder ID='TitleContent' runat='server'/></title> <link href='../../Content/Site.css' rel='stylesheet' type='text/css' /> </head> 

When I try to add defaulted text to the front of the content holder, it doesn’t show the text in the final rendered page. I am trying to get the page to show a default title with appended contentplaceholder text.

Example:
(Default Text) (ContentPlaceHolder Text)
My Page – About Us

<head runat='server'> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <title>My Page - <asp:ContentPlaceHolder ID='TitleContent' runat='server'/></title> <link href='../../Content/Site.css' rel='stylesheet' type='text/css' /> </head> 

I am looking for a way to accomplish this without having to use code behind. Any ideas?

  • 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. 2026-05-11T14:35:54+00:00Added an answer on May 11, 2026 at 2:35 pm

    After looking further, Phil Haack actually posted an article which was a solution to my question. It can be found at Haacked.

    In summary he said that everything that is rendered in the head is rendered as a control, and the fix for my question above is to put an asp literal control in the title to have it correctly generate the text.

    <%@ Master ... %> <html> <head runat='server'>   <title>     <asp:ContentPlaceHolder ID='titleContent' runat='server' />      <asp:LiteralControl runat='server' Text=' - MySite' />   </title> </head> ... 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

See code (am using Knockout.js over ASP MVC 3): @model List<Person> @{ ViewBag.Title =
I'm building an ASP.NET MVC 3 site using the code-first Entity Framework 4 approach.
Im using MVC-Viewmodel, EF Model first on my project. I have a foreach loop
2 questions: Does using MVC make it any easier to build 508/WAI compliant sites?
I'm using MVC, I've got a search page, and I want to pass multiple
I'm using MVC 2, and the Html.EditorForModel() to allow me to display an editor
I'm using MVC. I copied the login form from the login page and inserted
I'm using MVC 1.0 and have created a RequireSSLAttribute (like the one in ASP.NET
I'm using MVC 2 with some Models from a LinqToSql project that I built.
I am using MVC. How do I delete all records from the database using

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.