Article
Working with Page.Title
When using Master Pages in ASP.NET, deciding a way to dynamically title your pages can be a bit tricky.
In the past, I have used sitemap files and coded my Master page to determine the current node and display the sitemap node name in the title along with the site name. In a recent project I had all my pages with the site name and only wanted one page to have dynamic titles. My thought was to add some code behind to simply modify the page title. However I wanted to prepend the dynamic title to the site name - "Title of article - SiteName". Using the following in my content page:
Dim articleName as string
Page.Title = articleName
and the following in my Master page
Me.Page.Title = Me.Page.Title + " SiteName"
for some reason wasn't working. It turns out the 'Title=""' parameter in the content page directive was ove
Created 2/17/2010 12:13:26 PM
Updated 2/17/2010 2:01:38 PM