Wrox Programmer Forums
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 27th, 2011, 10:50 AM
Authorized User
Join Date: Apr 2005
Posts: 71
Thanks: 23
Thanked 0 Times in 0 Posts
Default Page title in master page

Hi all, I have created a template as detailed in the book. Originally In the template i had

<title>Welcome to Planet Wrox</title> as the page title.

I have since changed this in the master page to
title>.....Replace this.....</title> again as the page title.

Now when i create a new page based on the template the "Welcome to Planet Wrox" text is always inserted as the page title instead of ".....Replace this....."

Can anyone point me in the right direction as to why the new page title is not implemented.

Also how do you insert comments in the master page which will not be displayed in my browser. I have tried /* comments here */ but the comments are always displayed when i request a page in my browser.

Hope this makes sense

Old June 27th, 2011, 11:07 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi Mark,

The page overrules the title set in the master. To have new pages take the title, you need to re-export the tempate and then base your pages on this new template.

You can use server side comments as explained here: http://weblogs.asp.net/scottgu/archi....NET-2.0-.aspx


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
markhh (June 28th, 2011)
Old June 28th, 2011, 04:24 AM
Authorized User
Join Date: Apr 2005
Posts: 71
Thanks: 23
Thanked 0 Times in 0 Posts

Hi Imar and many thanks for your help

Old June 29th, 2011, 04:54 AM
Registered User
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Related question


a related question to this so i figured i would post in reply to this.

i am working on a CMS basically, custom mini CMS for some of our websites. Now the titles of the page ofcourse would be changing dynamically depending on the page which loads. We have the url rewriting in place to rewrite the url and also changing the titles.

Now the question is the way we are doing it is that we have set a global title which is in the database and the master page gets that and sets it as the title of the master page and the individual page when it loads after the master page has loaded it gets the title if there is any in the database and sets that as the title of the page, if title does not exists it does not place the title so ideally the master page title would stay.

Is this the best approach? Or can we do something better?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the Master page hoses site... Page 92... richv BOOK: Beginning SharePoint 2010 Development 19 December 30th, 2010 10:21 AM
How to print a web page without title, URL, page #, date and time Mattt C# 2 July 17th, 2009 03:02 AM
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.