locked
Can't Change Titles on Pages Made from Master Page RRS feed

  • Question

  • Hi,

    I created a master page, and included a contentplaceholder around the <title> tags. I created pages from the master page, changed the title text (tried it both from typing into the code panel AND doing it on the Properties pop up box).

    When I move the pages to the server, the pages all have the same title (the name of the master page), not the names I set.

    How can I make the different page titles show up?

    Thanks!

     

    Wednesday, March 2, 2011 8:26 PM

All replies

  • First: A master page is an asp.net page ending in .master.  Is this what you are talking about?  Or are you talking about a DWT, a file ending in .dwt?  We always have to ask, since EW uses "master.dwt" as the default DWT name in its templates. If you do mean a master page, what you describe should work, although you would have to edit it in Code View. (Create an on-page style to get the head content holder to show in Code View.) If it works when you preview locally, but not when you publish: are you sure you've published the latest master page? And that you are not looking at cached pages?
    Wednesday, March 2, 2011 9:00 PM
  • If you are using an asp.net master page, there are two ways that I know of.

    1. Non-programatically. Go into each content page, and in the line at the very top that starts with <%@page, add the title. Like this:

     

    <%@ Page  Language="VB" Title="My page title"   MasterPageFile="~/pwrdemos/links/MasterPage.master" ....

     

    2. Alternately, in the page load event of the content page, add page.title="My page title".

     

    Either way achieves the same end.

     

     

     


    Rick Dieffenbach
    www.ProfessionalWebsiteReview.com
    Tutorials for Reviewing Your Website
    Wednesday, March 2, 2011 9:56 PM
  • Those certainly are other ways.  Putting the title tag in a contentplaceholder in the head also works, in my testing.

    Wednesday, March 2, 2011 10:05 PM
  • Yes, I am talking about a master .aspx page.
    Saturday, March 5, 2011 12:18 PM
  • Here is what I have in my Search Data page:

    <%@ Page language="C#" masterpagefile="bookworm.master" title="Search Data" %>

     

    The title on all my pages (which all have the title changed in the code as above) all say the same thing, which is the title on the master aspx page. I thought that might be the problem, so I removed the title text from the master (left the content placeholder), and now all the pages have NO title, just the browser name.  :(

     

    Thanks!

     

    Saturday, March 5, 2011 12:27 PM
  • Can't help without seeing what you've actually done, not just your description of what you've done.   Sounds like you are randomly floundering with more than one way of setting the title, and we can't know what state you are actually left with.

    What's in the master page and what's in the content page.

     (And by that I mean, paste the appropriate portions of markup here, not a description.)

    Saturday, March 5, 2011 2:17 PM
  • <%@ Page language="C#" masterpagefile="bookworm.master" title="Search Data" %>

    Change the bolded text to what you want the title to be on the other pages.


    Free Expression Web Tutorials
    For an Expression Web forum with without the posting issues try expressionwebforum.com
    Saturday, March 5, 2011 4:54 PM