473,663 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set <title> and <meta name='descripti on'> with master page

Hi;

If I am using master pages, how do I set the <title> and <meta
name='descripti on' content='my title'> for each page. Obviously each page
will have a different title & description.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Mar 17 '06 #1
4 3825
David Thielen said:
Hi;

If I am using master pages, how do I set the <title> and <meta
name='descript ion' content='my title'> for each page. Obviously each page
will have a different title & description.


Hi,
The title is a no-brainer - i.e.:

<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er"
AutoEventWireup ="false" CodeFile="xxxx. aspx.vb"
Inherits="xxxx" Title="My Page Name" %>

The meta-data I'm not sure of. We haven't had a reason to try that.
Have you read the mini-MSDN help?

FWIW,

Greg G.
Mar 17 '06 #2
There's some new classes in 2.0...

// Add meta tags
//HtmlMeta meta1 = new HtmlMeta();
//meta1.Attribute s.Add("descript ion", "blah blah blah");
//HtmlHead head = (HtmlHead)Page. Header;
//head.Controls.A dd(meta1);

<%= Clinton Gallagher

"GregG" <Gr***@electron .com> wrote in message
news:k1******** *************** *********@4ax.c om...
David Thielen said:
Hi;

If I am using master pages, how do I set the <title> and <meta
name='descrip tion' content='my title'> for each page. Obviously each page
will have a different title & description.


Hi,
The title is a no-brainer - i.e.:

<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er"
AutoEventWireup ="false" CodeFile="xxxx. aspx.vb"
Inherits="xxxx" Title="My Page Name" %>

The meta-data I'm not sure of. We haven't had a reason to try that.
Have you read the mini-MSDN help?

FWIW,

Greg G.

Mar 17 '06 #3
I thought anything outside the <asp:Content... > was off-limitis - thanks

And no - what is the mini-MSDN help? I have watched the videos and those are
great BTW.

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"GregG" wrote:
David Thielen said:
Hi;

If I am using master pages, how do I set the <title> and <meta
name='descript ion' content='my title'> for each page. Obviously each page
will have a different title & description.


Hi,
The title is a no-brainer - i.e.:

<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er"
AutoEventWireup ="false" CodeFile="xxxx. aspx.vb"
Inherits="xxxx" Title="My Page Name" %>

The meta-data I'm not sure of. We haven't had a reason to try that.
Have you read the mini-MSDN help?

FWIW,

Greg G.

Mar 17 '06 #4
Hi Dave,

When using Master page, since the the master template is protected from
being modified in concrete page, it does somewhat limit some setting in the
master template. However, there still open the programmatic approach, e.g:

protected void Page_Load(objec t sender, EventArgs e)
{
Page.Title = "conPage";

HtmlMeta meta1 = new HtmlMeta();

meta1.Content = "JavaScript ";
meta1.Name = "vs_defaultClie ntScript";

Page.Header.Con trols.Add(meta1 );
}

Also, concrete page's Title can be configured in the @Page directive also.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3121
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some useful utils that more pages on that server can use. As an example, I have created a Page Counter class that opens an Access .mdb file, counts the current entries for that page, and adds a new entry with some information regarding the current...
8
4846
by: localhost | last post by:
I would like to wrap all of the HTML inside of my <body> tag inside a <div> with in my code-behind. I do not want to touch the .aspx page template at all. I know how to make the body tag runat=server and give it an id so I can find it from the code-behind, but after that I want to add the <div>. One problem I see is that I just add the <div> to the <body>, all of the other controls (including the aspx <form>) will not be inside it. What...
5
2015
by: DotNetGruven | last post by:
Hi, I have a web form which has: - Login area with - email textbox - password textbox - <enter> button to log in - search area with - string to search for textbox
4
2712
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the source of the files...
1
1863
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The master page looks like this... <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
5
2492
by: Arne | last post by:
I need literal controls in the <head> section of my page. I need to be able to load dynamic values in the head section. It works fine in ASP.Net 1.1, but Asp.net 2.0 gives a compile error. I need the dynamically assigned <base href='??'> and <META NAME="Description" CONTENT="??"> Is there a work around?
7
2708
by: samuelberthelot | last post by:
Hi, I have the following in my asp page: <% response.write(Header) %> where Header contains HTML markup such ass <html> <body> .... I must write the code in the aspx file and not in the code behind so that the markup are generated at correct places in html stream.
4
13320
by: Alex Maghen | last post by:
I have a master page which contains a general page framework and also contains a <form runat=server> around most of the content of the page. Inside that <form> tag is a ContentPlaceholder. I then create an ASPX which is tied to that MasterPage and in it a put a bunch of form fields and an <asp:Button />. When I try to run the page, I get... "Control 'ctl00_BodyCPH_ctl00' of type 'Button' must be placed inside a form tag with...
1
2576
by: Daimz | last post by:
I am making a blog and as part of my template I am wanting to have my header and then another image on the side of that using the z-index: 2; to make it that layer about. so here is the css. .splash { z-index: 2; width: 135px; height: 386px; margin: 0 auto; position: relative; left: 450px;
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.