By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,625 Members | 1,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,625 IT Pros & Developers. It's quick & easy.

Search engine optimisation of asp.net.20 pages.

P: n/a

Hello,

Does anyone know anything about how to optimise asp.net 2.0 pages for search
engines?
I'm thinking of a programmatic way of mapping sitemap structure to pages
meta tags. Well
it can always be done i'm just wondering of smart ways of doing it.

Thanks
JJ

WebMaster www.meelovia.com
Powered by ASP.Net 2.0
Aug 15 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
You need more than few meta tags to optmize you page to search engine..
anyway i do it that way..
make you html <head runat="server">

now you can add meta tage programatic..

BEService.Page pageservice = new BEService.Page();
DataTable hdt = (DataTable)pageservice .GetPageByID(urimngr.PageID);
if (hdt.Rows.Count == 0) return;

foreach (Control ctrl in this.Master.Controls)
{
if (ctrl is HtmlHead)
{
HtmlTitle title = new HtmlTitle();
title.Text = Convert.ToString(hdt.Rows[0]["Title"]);

// Any Script or tag you want add dynamicly.. for me i add
base url
Literal baseurl = new Literal();
baseurl.Text = string.Format("<base href=\"{0}\">",
ConfigurationManager.AppSettings.Get("BaseURL"));
HtmlMeta desc = new HtmlMeta();
desc.Name = "Description";
desc.Content = Convert.ToString(hdt.Rows[0]["Description"]);

HtmlMeta keyword = new HtmlMeta();
keyword.Name = "Keyword";
keyword.Content = Convert.ToString(hdt.Rows[0]["Keyword"]);

Literal additional = new Literal();
additional.Text =
Convert.ToString(hdt.Rows[0]["AdditinalHeadTags"]);

HtmlHead head = (HtmlHead)ctrl;
head.Controls.RemoveAt(0);
head.Controls.AddAt(0, title);
head.Controls.AddAt(1, desc);
head.Controls.AddAt(2, keyword);
head.Controls.AddAt(3, additional);
head.Controls.AddAt(4,baseurl);
}

}
What do u think??
Does it meet your needs??

Note : more best search engine optmization minimize use of linkbutton events
and use Hyperlinks instead, search engine spiders can't click you buttons
but it can alwasy follow your links. Good Luck.

"Jens Jensen" <jj@jensen.dkwrote in message
news:ee****************@TK2MSFTNGP04.phx.gbl...
>
Hello,

Does anyone know anything about how to optimise asp.net 2.0 pages for
search engines?
I'm thinking of a programmatic way of mapping sitemap structure to pages
meta tags. Well
it can always be done i'm just wondering of smart ways of doing it.

Thanks
JJ

WebMaster www.meelovia.com
Powered by ASP.Net 2.0

Aug 15 '06 #2

P: n/a

"Islamegy®" <Is******@Private.4meskrev i en meddelelse
news:%2****************@TK2MSFTNGP02.phx.gbl...
You need more than few meta tags to optmize you page to search engine..
anyway i do it that way..
make you html <head runat="server">

now you can add meta tage programatic..

BEService.Page pageservice = new BEService.Page();
DataTable hdt = (DataTable)pageservice
.GetPageByID(urimngr.PageID);
if (hdt.Rows.Count == 0) return;

foreach (Control ctrl in this.Master.Controls)
{
if (ctrl is HtmlHead)
{
HtmlTitle title = new HtmlTitle();
title.Text = Convert.ToString(hdt.Rows[0]["Title"]);

// Any Script or tag you want add dynamicly.. for me i add
base url
Literal baseurl = new Literal();
baseurl.Text = string.Format("<base href=\"{0}\">",
ConfigurationManager.AppSettings.Get("BaseURL"));
HtmlMeta desc = new HtmlMeta();
desc.Name = "Description";
desc.Content =
Convert.ToString(hdt.Rows[0]["Description"]);

HtmlMeta keyword = new HtmlMeta();
keyword.Name = "Keyword";
keyword.Content = Convert.ToString(hdt.Rows[0]["Keyword"]);

Literal additional = new Literal();
additional.Text =
Convert.ToString(hdt.Rows[0]["AdditinalHeadTags"]);

HtmlHead head = (HtmlHead)ctrl;
head.Controls.RemoveAt(0);
head.Controls.AddAt(0, title);
head.Controls.AddAt(1, desc);
head.Controls.AddAt(2, keyword);
head.Controls.AddAt(3, additional);
head.Controls.AddAt(4,baseurl);
}

}
What do u think??
Does it meet your needs??

Note : more best search engine optmization minimize use of linkbutton
events and use Hyperlinks instead, search engine spiders can't click you
buttons but it can alwasy follow your links. Good Luck.

"Jens Jensen" <jj@jensen.dkwrote in message
news:ee****************@TK2MSFTNGP04.phx.gbl...
>>
Hello,

Does anyone know anything about how to optimise asp.net 2.0 pages for
search engines?
It looks very good.

I will give it is try.
I guess the new asp.net 2.0 menu is useless with respect to SEO.

Many thanks
JJ

WebMaster www.meelovia.com
Powered by ASP.Net 2.0
Aug 15 '06 #3

P: n/a
The problem here ,is i use master pages.... Gets a bit more complicated.

and What is BEService???

Aug 15 '06 #4

P: n/a
Not complicated.. look at the code, I use masterpage too.. look at the
foreach loop :
foreach (Control ctrl in this.Master.Controls)
i loop in the masterpage controls, and you have to change the <headtag in
masterpage..

BEService... is a webservice, i use webservice as a data access layer.
"Jens Jensen" <jj@jensen.dkwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
The problem here ,is i use master pages.... Gets a bit more complicated.

and What is BEService???

Aug 15 '06 #5

P: n/a
Ok!
Very cool...
Aug 15 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.