<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learn ASP.NET programming,search engine optimization and web developement for biginners. &#187; search engine optimization</title>
	<atom:link href="http://speakasp.net/blog/index.php/tag/search-engine-optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://speakasp.net/blog</link>
	<description>ASP.net ,search engine optimization tutorials,code examples and explanations.</description>
	<lastBuildDate>Wed, 11 Nov 2009 15:40:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Generating search engine optimized page title and meta tags in asp.net.</title>
		<link>http://speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net/</link>
		<comments>http://speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 11:32:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET programming]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[web developing]]></category>
		<category><![CDATA[discription meta tag]]></category>
		<category><![CDATA[keyword positioning]]></category>
		<category><![CDATA[page title]]></category>
		<category><![CDATA[search engine optimization]]></category>

		<guid isPermaLink="false">http://speakasp.net/blog/?p=85</guid>
		<description><![CDATA[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 start <p>As 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 [...]]]></description>
			<content:encoded><![CDATA[<h2>The importance of search engine optimized page title and meta tags:</h2>
<address><strong><a title="SEO KEYWORDS POSITIONING" href="http://speakasp.net/blog/index.php/web-developing/seo/seo-tips-keywords-positioning/">May be you will need to read about seo in general from here before you start</a></strong></address>
<p>As 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.</p>
<p>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 .</p>
<h2>Page titles and meta tags generation in asp.net :</h2>
<p>As an asp.net developer you should learn how to generate and control page  titles and meta tags dynamically.</p>
<p>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</p>
<p>&lt;META NAME=&#8221;description&#8221; CONTENT=&#8221;your page description&#8221;/&gt;</p>
<p>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.</p>
<p>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.</p>
<p>so time for coding</p>
<h3>Generating page title and meta tags dynamically explained  vb.net code example:</h3>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>and here is the code behind</p>
<p><strong>Page title:</strong></p>
<p><strong>in the page load event add the following code</strong></p>
<blockquote><p>Dim ptitle As String<br />
ptitle =  DirectCast(FormView1.FindControl(&#8220;ptitlelbl&#8221;), Label).Text<br />
If  String.IsNullOrEmpty(ptitle) Then</p>
<p>Else</p>
<p>Page.Title = &#8221; any thing you want to append&#8221; &amp;  ptitle<br />
End If</p></blockquote>
<p>and you done just be sure that there is <strong>no</strong> static page title  tag anywhere (page declaration section, header section of the aspx file or in  the master page) not to have unexpected results.</p>
<p>1-we declared a variable to hold the title.</p>
<p>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 ).</p>
<p>3-we check first if the variable is not empty to prevent the ugly looking  exception.</p>
<p>4-we used “directcast” because “findcontrol” function return an undefined  control so to define the returning object as a label we use “directcast”  function.</p>
<p>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) .</p>
<p><strong>Meta tags(description ex. ):</strong></p>
<p><strong>also in the page load event add the following vb.net code</strong></p>
<blockquote><p>Dim ptitle As String<br />
disctext =  DirectCast(FormView1.FindControl(&#8220;mdisclbl&#8221;), Label).Text<br />
If  String.IsNullOrEmpty(disctext) Then</p>
<p>Else</p>
<p>Dim headsection As HtmlHead = CType(Me.Header,  HtmlHead)<br />
Dim discmetatag As HtmlMeta = New  HtmlMeta()<br />
discmetatag.Name = &#8220;Description&#8221;<br />
discmetatag.Content = &#8220;any thing you want to append ,&#8221;  &amp; disctext<br />
headsection.Controls.Add(discmetatag)<br />
End If</p></blockquote>
<p>here the code is similar to the code above  except:</p>
<p>1-first we create an instance of our page head section.</p>
<p>2-next we defined a new html meta object.</p>
<p>3-we set its name proberity to “description”(or keyword if you want)</p>
<p>4-then set its content to the text we extracted from the data base.</p>
<p>5-finally we add the meta tag object we created to our page header section</p>
<p>and you are done</p>
<h2>some useful tips in generating asp.net page title and description meta  tags:</h2>
<p>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.</p>
<p>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.</p>
<p>3-it is far better to have only h1 tag in each page not more this will keep  your page targeted.</p>
<p><a title="SEO KEYWORDS SELECTION" href="http://speakasp.net/blog/index.php/web-developing/seo/seo-tips-keyword-selection/">IF YOU WANT TO KNOW HOW TO SELECT YOUR KEY WORDS READ THIS</a></p>
<p>happppy coding and alot of money.</p>
<p>dr A. galal</p>
<p>asp.net developer and seo specialist.</p>
<p>dr.agalal@speakasp.net</p>



Share and Enjoy:


	<a rel="nofollow" id="print"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;partner=sociable" title="Print"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow" id="digg"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20&amp;bodytext=The%20importance%20of%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%3A%0D%0AMay%20be%20you%20will%20need%20to%20read%20about%20seo%20in%20general%20from%20here%20before%20you%20startAs%20a%20asp.net%20developer%20it%20is%20very%20important%C2%A0%20when%20you%20start%20to%20build%20a%20web%20site%20to%20make%20it%20search%20%20engin" title="Digg"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" id="sphinn"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F" title="Sphinn"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow" id="del.icio.us"  href="http://delicious.com/post?url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20&amp;notes=The%20importance%20of%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%3A%0D%0AMay%20be%20you%20will%20need%20to%20read%20about%20seo%20in%20general%20from%20here%20before%20you%20startAs%20a%20asp.net%20developer%20it%20is%20very%20important%C2%A0%20when%20you%20start%20to%20build%20a%20web%20site%20to%20make%20it%20search%20%20engin" title="del.icio.us"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" id="facebook"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;t=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20" title="Facebook"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow" id="mixx"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20" title="Mixx"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a>
	<a rel="nofollow" id="google"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20&amp;annotation=The%20importance%20of%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%3A%0D%0AMay%20be%20you%20will%20need%20to%20read%20about%20seo%20in%20general%20from%20here%20before%20you%20startAs%20a%20asp.net%20developer%20it%20is%20very%20important%C2%A0%20when%20you%20start%20to%20build%20a%20web%20site%20to%20make%20it%20search%20%20engin" title="Google Bookmarks"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a  id="blogplay"  href="http://blogplay.com" title="Blogplay"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/blogplay.png" title="Blogplay" alt="Blogplay" class="sociable-hovers" /></a>
	<a rel="nofollow" id="dotnetkicks"  href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20" title="DotNetKicks"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/dotnetkicks.png" title="DotNetKicks" alt="DotNetKicks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="yahoo!bookmarks"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;t=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20&opener=bm&amp;ei=UTF-8&amp;d=The%20importance%20of%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%3A%0D%0AMay%20be%20you%20will%20need%20to%20read%20about%20seo%20in%20general%20from%20here%20before%20you%20startAs%20a%20asp.net%20developer%20it%20is%20very%20important%C2%A0%20when%20you%20start%20to%20build%20a%20web%20site%20to%20make%20it%20search%20%20engin" title="Yahoo! Bookmarks"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="linkedin"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20&amp;source=Learn+ASP.NET+programming%2Csearch+engine+optimization+and+web+developement+for+biginners.+ASP.net+%2Csearch+engine+optimization+tutorials%2Ccode+examples+and+explanations.&amp;summary=The%20importance%20of%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%3A%0D%0AMay%20be%20you%20will%20need%20to%20read%20about%20seo%20in%20general%20from%20here%20before%20you%20startAs%20a%20asp.net%20developer%20it%20is%20very%20important%C2%A0%20when%20you%20start%20to%20build%20a%20web%20site%20to%20make%20it%20search%20%20engin" title="LinkedIn"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow" id="live"  href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;title=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20" title="Live"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a>
	<a rel="nofollow" id="myspace"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F&amp;t=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20" title="MySpace"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a>
	<a rel="nofollow" id="technorati"  href="http://technorati.com/faves?add=http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F" title="Technorati"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow" id="twitter"  href="http://twitter.com/home?status=Generating%20search%20engine%20optimized%20page%20title%20and%20meta%20tags%20in%20asp.net.%20%20-%20http%3A%2F%2Fspeakasp.net%2Fblog%2Findex.php%2Fweb-developing%2Fgenerating-search-engine-optimized-meta-tags-page-title-asp-net%2F" title="Twitter"><img src="http://speakasp.net/blog/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://speakasp.net/blog/index.php/web-developing/generating-search-engine-optimized-meta-tags-page-title-asp-net/feed/</wfw:commentRss>
		<slash:comments>3242</slash:comments>
		</item>
	</channel>
</rss>

