Reply
Use Master page but different title for pages
Old 09-02-2006, 05:02 AM Use Master page but different title for pages
Experienced Talker

Posts: 34
I have defined <head> and <title> tags in the master page as follow:
<head id="Head1" runat="server">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
Now I want that the title of the page varry from page tom page and won't be the same in
all pages.when I put<title> in the form1 that use the above master page.I encounter error.
In summary How could Use Master page while each page has it's own title tag.

Last edited by s2002 : 09-02-2006 at 05:04 AM.
s2002 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 09-02-2006, 08:09 AM Re: Use Master page but different title for pages
Minaki's Avatar
Cheerleader

Posts: 1,626
Location: Guildford, UK
Look in the <@Page directive at the very top of the content page. There's an attribute to set the title in there.

Alternatively, you can set it in the code-behind by using Page.Title = "My New Title"
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 12-14-2006, 08:51 AM Re: Use Master page but different title for pages
Junior Talker

Posts: 1
Name: Craig
Does anyone know how to have a different meta description for the non-master pages? I see a Description attirbute in the Page directive, but when the pages renders to the browser and I view the source I do not see the meta desciption tag.
craigwillard is offline
Reply With Quote
View Public Profile
 
Old 01-18-2007, 06:28 AM Re: Use Master page but different title for pages
saadatshah's Avatar
Extreme Talker

Posts: 216
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Add a property to Master page like:

public bool AddMeta
{
set { _AddMeta=value;}
}

On Master PAGE LOAD:

protectedvoid Page_Load(object sender, EventArgs e)
{

if (_AddMeta)
{

Page.Header.Controls.Add(newLiteralControl(@"<meta>"));
}
}

On Child Pages Call it like:

MasterPage objMaster = (MasterPage)this.Master;
objMaster.AddMeta = true;
__________________
Traffic School - Driver Ed - Defensive Driving - Texas Defensive Driving - Online Traffic School - Defensive Driving Course
If you have knowledge, let others light their candles in it.

Last edited by saadatshah : 01-18-2007 at 06:29 AM.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to Use Master page but different title for pages
 

Thread Tools

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12544 seconds with 13 queries