Search engine optimisation of asp.net.20 pages.

J

Jens Jensen

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
 
I

Islamegy®

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.
 
J

Jens Jensen

Islamegy® said:
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 said:
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
 
J

Jens Jensen

The problem here ,is i use master pages.... Gets a bit more complicated.

and What is BEService???
 
I

Islamegy®

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 <head> tag in
masterpage..

BEService... is a webservice, i use webservice as a data access layer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top