Before discussing about ASP.Net 4 SEO Improvements methodology firstly we have focused on why SEO? Search engine optimization (SEO) is important for any publically facing web-site. A large percentage of traffic to sites now comes from search engines, and improving the search relevancy of your site will lead to more user traffic to your site from search engine queries (which can directly or indirectly increase the revenue you make through your site).
ASP.Net 4 SEO Improvements:
ASP.NET 4 includes a bunch of new runtime features that can help you to further optimize your site for SEO. Some of these new features include:
1. New Page.MetaKeywords and Page.MetaDescription properties
2. New URL Routing support for ASP.NET Web Forms
3. New Response.RedirectPermanent() method
Below are details about how you can take advantage of them to further improve your search engine relevancy.
New Page.MetaKeywords and Page.MetaDescription properties:
One simple recommendation to improve the search relevancy of pages is to make sure you always output relevant “keywords” and “description” <meta> tags within the <head> section of your HTML. For example:
<title>Abstraction in c# with example - MindStick</title>
<meta name="Keywords" content="C#.Net, .Net, OOPS Concept, OOPS Basic" />
<meta name="Description" content="Abstraction in c# with example, In object-oriented software, complexity is managed by using abstraction. " />
One of the nice improvements with ASP.NET 4 Web Forms is the addition of two new properties to the Page class: MetaKeywords and MetaDescription that make programmatically setting these values within your code-behind classes much easier and cleaner.
protected void Page_Load(object sender, EventArgs e)
Page.Title = "Your Title Here";
Page.MetaDescription = "Your description here";
Page.MetaKeywords = "Your keywords here";
In addition to setting the Keywords and Description properties programmatically in your code-behind, you can also now declaratively set them within the @Page directive at the top of .aspx pages. The below snippet demonstrates how to-do this:
<%@ Page Title="Abstraction in c# with example" keywords="C#.Net, .Net, OOPS Concept, OOPS Basic, Abstraction C#, Abstraction in C#.Net" Description="Abstraction in c# with example, In object-oriented software, complexity is managed by using abstraction." Language="C#" MasterPageFile="~/MySite.master" %>
New URL Routing support for ASP.NET Web Forms:
URL routing was a capability we first introduced with ASP.NET 3.5 SP1, and which is already used within ASP.NET MVC applications to expose clean, SEO-friendly “web 2.0” URLs. URL routing lets you configure an application to accept request URLs that do not map to physical files. Instead, you can use routing to define URLs that are semantically meaningful to users and that can help with search-engine optimization (SEO).
For example; the URL for a traditional page that displays product categories might look like below:
For more details in URL Routing check out the following link:
New Response.RedirectPermanent() method:
It is pretty common within web applications to move pages and other content around over time, which can lead to an accumulation of stale links in search engines.
In ASP.NET, developers have often handled requests to old URLs by using the Response.Redirect() method to programmatically forward a request to the new URL. However, what many developers don’t realize is that the Response.Redirect() method issues an HTTP 302 Found (temporary redirect) response, which results in an extra HTTP round trip when users attempt to access the old URLs. Search engines typically will not follow across multiple redirection hops – which means using a temporary redirect can negatively impact your page ranking. You can use the SEO Toolkit to identify places within a site where you might have this issue.
ASP.NET 4 introduces a new Response.RedirectPermanent(string url) helper method that can be used to perform a redirect using an HTTP 301 (moved permanently) response. This will cause search engines and other user agents that recognize permanent redirects to store and use the new URL that is associated with the content. This will enable your content to be indexed and your search engine page ranking to improve.
Below is an example of using the new Response.RedirectPermanent() method to redirect to a specific URL:
ASP.NET 4 also introduces new Response.RedirectToRoute(string routeName) and Response.RedirectToRoutePermanent(string routeName) helper methods that can be used to redirect users using either a temporary or permanent redirect using the URL routing engine.