Connecting Tech Pros Worldwide Forums | Help | Site Map

how to add unique meta tags to each content page/

bashetty@gmail.com
Guest
 
Posts: n/a
#1: Mar 26 '07
Well its a strange problem i have, some of you might already faced it
and have a solution. I have to maintain a set of unique "search key
words" in meta tags for each content page in my site. With master
paging , i guess i can only have <headtag in my MasterPage. Can any
one let me know how to resovle this issue?


bruce barker
Guest
 
Posts: n/a
#2: Mar 26 '07

re: how to add unique meta tags to each content page/


add a SearchKeys property to your master page which your other pages can
set and have the master render the proper meta tag.

-- bruce (sqlwork.com)

bashetty@gmail.com wrote:
Quote:
Well its a strange problem i have, some of you might already faced it
and have a solution. I have to maintain a set of unique "search key
words" in meta tags for each content page in my site. With master
paging , i guess i can only have <headtag in my MasterPage. Can any
one let me know how to resovle this issue?
>
Cowboy \(Gregory A. Beamer\)
Guest
 
Posts: n/a
#3: Mar 26 '07

re: how to add unique meta tags to each content page/


Add using code behind. Page.Header opens up a whole new world when setting
items in the header portion of the master page. :-)

Example for changing title of page (in Page_Load, etc.)

Page.Header.Title = "Some title";

You can also set up meta tags, like so

HtmlMeta metaTag = new HtmlMeta();
metaTag.HttpEquiv = "";
metaTag.Content = "";

Good luck!

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
<bashetty@gmail.comwrote in message
news:1174933702.185190.223960@e65g2000hsc.googlegr oups.com...
Quote:
Well its a strange problem i have, some of you might already faced it
and have a solution. I have to maintain a set of unique "search key
words" in meta tags for each content page in my site. With master
paging , i guess i can only have <headtag in my MasterPage. Can any
one let me know how to resovle this issue?
>
ua
Guest
 
Posts: n/a
#4: Mar 26 '07

re: how to add unique meta tags to each content page/


I stored the metadata of each file in a database and used the master
record page to add the appropriate scripts to the page like this.

// retrieve and set the metadata
TempDataSetTableAdapters.TWeb_PageMetaDataTableAda pter adpt =
new
TreborSetTableAdapters.TWeb_PageMetaDataTableAdapt er();
TempDataSet.TWeb_PageMetaDataDataTable pmdDT =
adpt.GetPageMetaDataByPageURL(Request.AppRelativeC urrentExecutionFilePath.ToLower());

// if we didn't find a record from the database retrieve the
general one
if (pmdDT.Count <= 0)
{
pmdDT = adpt.GetPageMetaDataByPageURL("general");
}

// if we have a record for meta data, create the tags
if (pmdDT.Count 0)
{
// Render: <meta name="keywords" content="some words" />
HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = pmdDT[0].keywords;
this.Page.Header.Controls.Add(keywords);

// Render: <meta name="robots" content="noindex" />
HtmlMeta robots = new HtmlMeta();
robots.Name = "robots";
robots.Content = pmdDT[0].robots;
this.Page.Header.Controls.Add(robots);

// Render: <meta name="description" content="some
description" />
HtmlMeta description = new HtmlMeta();
description.Name = "description";
description.Content = pmdDT[0].description;
this.Page.Header.Controls.Add(description);

// Render: <meta name="date" content="2006-03-25"
scheme="YYYY-MM-DD" />
HtmlMeta date = new HtmlMeta();
date.Name = "date";
date.Content = DateTime.Now.ToString("yyyy-mm-dd");
date.Scheme = "YYYY-MM-DD";
this.Page.Header.Controls.Add(date);
}

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
Guest
 
Posts: n/a
#5: Mar 27 '07

re: how to add unique meta tags to each content page/


You could specify your keyword metatags centrally in your sitemap file.

Then they can be added dynamically as shown in this example:
http://SteveOrr.net/articles/Spiders.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamMwrote in
message news:%23y52ye9bHHA.240@TK2MSFTNGP03.phx.gbl...
Quote:
Add using code behind. Page.Header opens up a whole new world when setting
items in the header portion of the master page. :-)
>
Example for changing title of page (in Page_Load, etc.)
>
Page.Header.Title = "Some title";
>
You can also set up meta tags, like so
>
HtmlMeta metaTag = new HtmlMeta();
metaTag.HttpEquiv = "";
metaTag.Content = "";
>
Good luck!
>
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
>
*********************************************
Think outside the box!
*********************************************
<bashetty@gmail.comwrote in message
news:1174933702.185190.223960@e65g2000hsc.googlegr oups.com...
Quote:
>Well its a strange problem i have, some of you might already faced it
>and have a solution. I have to maintain a set of unique "search key
>words" in meta tags for each content page in my site. With master
>paging , i guess i can only have <headtag in my MasterPage. Can any
>one let me know how to resovle this issue?
>>
>
Closed Thread