The importance of search engine optimized page title and meta tags:
May be you will need to read about seo in general from here before you startAs a asp.net developer it is very important when you start to build a web site to make it search engine friendly as possible to get the maximum number of free traffic. One of the most important requirement for any webpage to be search engine friendly is to have a unique,unrepeated and very closely related page title and meta tags. Search engine is giving a a great importance to the text present in the page title and think it the best way to discover what the page is about ,also search engine use your description meta tag( if you used it properly ) to write the page description that appear below the page title in the search result.
When you have a unique description meta tag that is very related to your page content the search engine will use it but if the description meta tag is not unique too short or not related to the page the search engine will choose other text from the page and use it as a description for your page. That automatically chosen text won’t be sexy for the people to click at which can affect you traffic badly. Also if the page title is repeated or not related to the page you will rank very low for your targeted keywords because there will be other competitive pages with a better page titles .
Page titles and meta tags generation in asp.net:
As an asp.net developer you should learn how to generate and control page titles and meta tags dynamically.
For any physical asp.net page that has only one version like the “contact us” page or “about the company” page there will be no problem you just will set the page title and the meta tags statically like if you are preparing a simple html page.Just find the title attribute in the page declaration part of the asp.net aspx page(usually the first line in page ),and set the title property to the value you want and for the meta tags you just add it to the head part of the page like thgis
<META NAME=”description”CONTENT=”your page description”/>
But the problem is in the asp.net pages that display a different row from the data base every time based on the query string value or something. Also the pages that display contents based on the user country or language.
As i want this article to be easy to understand for the beginner asp.net developer i will explain a very basic example here. We have a scenario that we want to make a details page that display the details of a single product selected on the base of the query string field called “productid”. Sure we will need to generate page title and meta tags dynamically because search engine will see “/productdetails.aspx?productid=1” and “/productdetails.aspx?productid=2” as a totally different pages that must have different page titles,also suppose that the first page is displaying a football and the other page displaying a diving equipment so the page title have to be generated every time the asp.net page load to be related to the product displayed and rank high when someone search for the diving eq. for example.
so time for coding
Generating page title and meta tags dynamically explained vb.net code example:
To fulfill the requirement of the scenario described above we will add a three fields to the data base “pagetitle”,”descriptionmeta ” and “keyeordmeta” to store the page title and meta tags for each product these fields should be filled by the seo specialist.
We can make it easier by using product name as the page title and the product description as the page meta description but i prefer separating what is for humans from what is for search engines because each has it’s rules.
Prepare a page containing form view the form view will display one row from the products table on the base of the query string passed with the url.
add two data bound asp.net labels to the asp.net formview with ID’s “ptitlelbl”, “mdisclbl” the first id data bounded to the data base field that hold the page title and the other is bounded to the meta description field.
and here is the code behind
Page title:
in the page load event add the following code
Dim ptitle As String
ptitle = DirectCast(FormView1.FindControl(“ptitlelbl”),Label).Text
If String.IsNullOrEmpty(ptitle) ThenElse
Page.Title = ”any thing you want to append”&ptitle
End If
and you done just be sure that there is no static page title tag anywhere (page declaration section,header section of the aspx file or in the master page) not to have unexpected results.
1-we declared a variable to hold the title.
2-we used “formview1.findcontrol” function to find the asp.net label we want inside the formview(notice form view is naming container so you cant access the control inside it directly like usual ).
3-we check first if the variable is not empty to prevent the ugly looking exception.
4-we used “directcast” because “findcontrol” function return an undefined control so to define the returning object as a label we use “directcast” function.
5-then we set the “title” property of the “page” object to the value we extracted from the data base and append to it any text we want(may be product category for example) .
Meta tags(description ex. ):
also in the page load event add the following vb.net code
Dim ptitle As String
disctext = DirectCast(FormView1.FindControl(“mdisclbl”),Label).Text
If String.IsNullOrEmpty(disctext) ThenElse
Dim headsection As HtmlHead = CType(Me.Header,HtmlHead)
Dim discmetatag As HtmlMeta = New HtmlMeta()
discmetatag.Name = “Description”
discmetatag.Content = “any thing you want to append ,”& disctext
headsection.Controls.Add(discmetatag)
End If
here the code is similar to the code above except:
1-first we create an instance of our page head section.
2-next we defined a new html meta object.
3-we set its name proberity to “description”(or keyword if you want)
4-then set its content to the text we extracted from the data base.
5-finally we add the meta tag object we created to our page header section
and you are done
some useful tips in generating asp.net page title and description meta tags:
1-it is sometimes important to add different countries or cities to the page title and meta tags because people usually search for service that is located close to them.For example if you have a car rent website may be you should dynamically generate many instances of your pages each one is targeted to different cities in your country.believe me it is great tip you should try it if you are making a website that offer a local service.
2-put the most important text in your page in a h1 tag. in our case above it will make a great difference to put the product name asp.net label in a h1 tag and may be making it bold text also.
3-it is far better to have only h1 tag in each page not more this will keep your page targeted.
IF YOU WANT TO KNOW HOW TO SELECT YOUR KEY WORDS READ THIS
happppy coding and alot of money.
dr A. galal
asp.net developer and seo specialist.
dr.agalal@speakasp.net

Websites you should visit…
[...]below you’ll find the link to some sites that we think you should visit[...]……
Useful and precise…
Its difficult to find really informative and precise info but here I found…
Awesome website…
[...] normally posts some quite interesting stuff such as this. If you are new to this page [...]…
Read was interesting,stay in touch……
[...]please visit the sites we follow,including this one,as it represents our picks from the web[...]……
Directions…
Here are some directives we can pursue….
You should check this out…
[...] Wonderful story,reckoned we could combine a few unrelated data,nevertheless really worth taking a look,whoa did one learn about Mid East has got more problerms as well [...]……
Websites we think you should visit…
[...]although websites we backlink to below are considerably not related to ours,we feel they are actually worth a go through,so have a look[...]……
my trackback…
I saw this really good post today….
Nice site…
This is a nice site….
my trackback…
I saw this really decent post today….
Online Article……
[...]The information mentioned in the article are some of the best available [...]……
…[Trackback]…
[...] Read More here:speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net [...]…
Hi…
hi!,I love your writing so so much! share we keep up a correspondence more approximately your article on AOL? I need an expert in this space to resolve my problem. Maybe that’s you! Looking forward to see you….
Nice site…
This is a great site….
…[Trackback]…
[...] There you will find 71948 more Infos:speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net [...]…
Nice site…
This is a great site….
You should check this out…
[...] Wonderful story,reckoned we could combine a few unrelated data,nevertheless really worth taking a look,whoa did one learn about Mid East has got more problerms as well [...]……
Read was interesting,stay in touch……
[...]please visit the sites we follow,including this one,as it represents our picks from the web[...]……
mira hair oil…
Mira hair oil contains herbs like aloe vera and Eclipta alba that grow long hair fast. It also uses coconut oil….
Up and Coming Blogs…
[...]Here are some of the webpages we definitely recommend for our fans[...]……
Recommeneded websites…
[...]Here are some of the sites we recommend for our visitors[...]……
Recommended websites…
[...] Are you positively convinced that is going to be right facts? I learned something different. I’ve basically had another theory that stick right into my mind [...]…
Sites we Like……
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……
Great website…
[...]we like to honor many other internet sites on the web,even if they aren’t linked to us,by linking to them. Under are some webpages worth checking out[...]……
Awesome website…
[...]the time to read or visit the content or sites we have linked to below the[...]……
Superb webpage…
[...] very few sites that had been shown below,from our own opinion are without any doubt well worth going over [...]…
…[Trackback]…
[...] Read More Infos here:speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net [...]…
Cool sites…
[...]we came across a cool site that you might enjoy. Take a look if you want[...]……
[...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate,just click the links over[...]……
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……
Websites we think you should visit…
[...]although websites we backlink to below are considerably not related to ours,we feel they are actually worth a go through,so have a look[...]……
Great website…
[...]we like to honor many other internet sites on the web,even if they aren’t linked to us,by linking to them. Under are some webpages worth checking out[...]……
Wow!…
A very awesome post….
Great website…
[...]we like to honor many other internet sites on the web,even if they aren’t linked to us,by linking to them. Under are some webpages worth checking out[...]……
Great Articles…
[...]The information mentioned in the blog are some of the best available on the [...]……
Thank you and please keep updating your website. I will come to ever do so.
UK’s leading SEO Company…
Offering a complete range of SEO services to match your budget….
Websites worth visiting…
[...]here are some links to sites that we link to because we think they are worth visiting[...]……
avg free download…
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose avg free download[...]……
[...]Sites of interest we have a link to[...]……
[...]usually posts some very interesting stuff like this. If you’re new to this site[...]……
open office…
[...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose open office[...]……
Links…
[...]Sites of interest we have a link to[...]……
Gems form the internet…
[...]very few websites that happen to be detailed below,from our point of view are undoubtedly well worth checking out[...]……
Check this out…
[...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate,just click the links over[...]……
The best website……
[...] requires fairly long time for achieving good results. One will need to have real persistence [...]…
…[Trackback]…
[...] Find More:speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net/ [...]…
Visitor recommendations…
[...]one of our visitors recently recommended the following website[...]……
Yahoo Backlinks Service…
Hi there,just wanted to say,I liked this blog post. It was helpful. Keep on posting!…
Online Article……
[...]The information mentioned in the article are some of the best available [...]……
[...]Sites of interest we have a link to[...]……
[...]usually posts some very interesting stuff like this. If you’re new to this site[...]……
Simply Amazing!…
This is some awosome IDEA! Wow Where do you come up with this stuff! Look im a long time reader of this blog and i am always amaized at your train of thought!…