Page Title

M

Miro

I have a "Master" page and I have 2 pages created from that master.

I want my page title to change with each page.

If I do this in the master

<head runat="server">
<title>My Home Page</title>


Is there a way I can "reference" the title tag in each aspx.page that uses
the master?

Or do I have to create the "Maste Object" and change the title on "Page
load"

Thanks

Miro
 
A

Andrew Meador

When you create a page that uses amaster page you set the Title for
the content page in the first line of the content page with the Page
"Title" property. Like the following:

<%@ Page Title="My Content Page" Language="C#" MasterPageFile="~/
MasterPage.master" AutoEventWireup="true" CodeFile="testfile.aspx.cs"
Inherits="testfile" %>

If you don't supply a Page Tile, the Title used in the Master Page
will show. If you supply this page title, it will override the master
page title.


Andrew
 
M

Miro

Thank you Andrew.

I started googling and found way more complictated results...and knew there
had to be an easier way.

Worked like a charm.

Cheers'

Miro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top