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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:18:07+00:00 2026-05-23T00:18:07+00:00

I am using ASP.NET MVC 2 & 3 with aspx View not Razor View,

  • 0

I am using ASP.NET MVC 2 & 3 with aspx View not Razor View, my question is:

How to set the title in Site.Master page? I wish every pages which use Site.Master page can add a Master title follow the page title show like: “Index -MasterTitle” ; “About -MasterTitle”.

I’ve try in Site.Master page and it’s doesn’t work:

<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    -MasterTitle
</title>

so I try to use asp:Literal server control:

<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    <asp:Literal  runat="server">-MasterTiltle</asp:Literal>
</title>

Or:

<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    <asp:Literal  runat="server" Text="-MasterTiltle"></asp:Literal>
</title>

fine, it’s solve the problem, but later I want to load the value of MasterTitle from web.config, I’ve try:

<asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    <asp:Literal runat="server">
        <%: System.Web.Configuration.WebConfigurationManager.AppSettings["SiteTile"] %>
    </asp:Literal>
</asp:Literal>

compiler toled me a server control can’t contain a child control, so I try the other:

<title>
    <asp:ContentPlaceHolder ID="TitleContent" runat="server" />
        <asp:Literal ID="ltlTitleBack" runat="server" Text='<%: System.Web.Configuration.WebConfigurationManager.AppSettings["SiteTile"] %>' > 
    </asp:Literal>
</title>

it’s compiler ok but not the answer what I want cause it show: “pagetilte <%: System.Web.Configuration.WebConfigurationManager.AppSettings[“SiteTile”] %>“

and later I found a way can solve this problem here: CodeExpressionBuilder

but I think that is not a proper solution cause I should set too many things that not relate to ASP MVC. Is there any better solution can solve this problem?

Note:

  1. I don’t want set the value of MasterTitle in every pages not Site.Master page, that’s a stupid way.
  2. I don’t want set the value of MasterTitle in Controller or Action or Model, that’s not right.
  3. I don’t want set the value of MasterTitle via ViewData.
  4. I don’t want to use CodeExpressionBuilder.
  5. I’m not use Razor View.

thanks for any help.

Edit: Actually I want something like web.config so I can change the value of MasterTitle when server is running. 🙂

  • 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-05-23T00:18:08+00:00Added an answer on May 23, 2026 at 12:18 am

    I had similar issues and here is what I had to use:

    <title>
        <asp:ContentPlaceHolder ID="TitleContent" runat="server" /><%= "-MasterTitle" %>
    </title>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this site is written using ASP.Net MVC and I do not see
Here's the situation: ASP.NET MVC 3 application using Razor as the view engine. Works
Using asp.net MVC I'd like to do this inside a view: <%= Html.TextBox(textbox1, null,
I've been developing a site using ASP.NET MVC, and have decided to use the
I am using ASP.NET MVC 2 & .Net 3.5 with Visual Studio 2008. Ok,
In my asp.net mvc site, I'm loading flash files using swfobject. These files work
I am using ASP.NET MVC 3 (Release Candidate 2) with razor templates. I am
How do I remain DRY with asp.net mvc view models & data annotation (validation,
Using Asp.Net-MVC music store tutorial, concrete page is at : http://www.asp.net/mvc/tutorials/mvc-music-store-part-3 <ul> @foreach (var
Using ASP.NET MVC there are situations (such as form submission) that may require a

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.