|
Subject:
|
META tags and master pages
|
|
Posted By:
|
thenoseknows
|
Post Date:
|
10/5/2006 6:10:40 PM
|
Does anyone know how to make dynamic meta tags with master pages?
Neil Timmerman Programmer Veris Consulting
|
|
Reply By:
|
Imar
|
Reply Date:
|
10/9/2006 1:02:50 PM
|
Hi there,
You can add HtmlMeta controls to the header, like this: // Set the keywords tag
HtmlMeta metaTag = new HtmlMeta();
metaTag.Name = "keywords";
metaTag.Content = "My, Keywords";
Page.Header.Controls.Add(metaTag);
// Set the description tag
metaTag = new HtmlMeta();
metaTag.Name = "description";
metaTag.Content = "My Description";
Page.Header.Controls.Add(metaTag); In addition to this, your master page can expose string properties for the keywords and description tags that you can set from the content pages.
HtH,
Imar --------------------------------------- Imar Spaanjaars Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|