Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 27th, 2011, 10:50 AM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: , , United Kingdom.
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
Mark


Reply With Quote
  #2 (permalink)  
Old June 27th, 2011, 11:07 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
markhh (June 28th, 2011)
  #3 (permalink)  
Old June 28th, 2011, 04:24 AM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: , , United Kingdom.
Posts: 71
Thanks: 23
Thanked 0 Times in 0 Posts
Default

Hi Imar and many thanks for your help

Mark
Reply With Quote
  #4 (permalink)  
Old June 29th, 2011, 04:54 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Related question

Hi,

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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:19 PM.


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