473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to add unique meta tags to each content page/

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?

Mar 26 '07 #1
4 2805
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)

ba******@gmail.com wrote:
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?
Mar 26 '07 #2
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!
*********************************************
<ba******@gmail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
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?
Mar 26 '07 #3
ua
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);
}

Mar 26 '07 #4
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)" <No************@comcast.netNoSpamMwrote in
message news:%2***************@TK2MSFTNGP03.phx.gbl...
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!
*********************************************
<ba******@gmail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
>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?
Mar 27 '07 #5

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

Similar topics

24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
2
by: laredotornado | last post by:
Hello, How effective are META tags when used as tools to classify a page's content for a search engine? The common one is <META NAME="Keywords" CONTENT="tropical fish,fish,tetras,guppies"> ...
1
by: Eric Levin | last post by:
I would like to load the Meta Tags in the page from Code: Currently they don't come up. The Source that I have: private void LoadHeaders() { DataSet oDs = new DataSet();
7
by: Rolf Welskes | last post by:
Hello, Master-Content in asp.net is very powerful. But: I have the following: One Master-Form. 30 Content-Forms which are the webpages used. Each of this content-forms must have own...
16
by: Edward | last post by:
Hi All, I am having huge problems with a very simple dotnet framework web page (www.gbab.net/ztest3.aspx) , it does NOT render correctly under Apple's Safari. The DIV's do not align amd float as...
1
by: bashetty | last post by:
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...
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
3
by: Jordan S. | last post by:
I'm looking to localize an ASP.NET Web application for English, Spanish, and French (fr-CA), and was just considering the possibility of localizing the meta tags (e.g., keywords, title, and...
5
by: Candoer | last post by:
All I have the following meta tags on every page of my web site (www.candoer.org). Are they necessary on every page or only on the index page? <meta name="robot" content="noindex; nofollow">...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.