ASP. NET 4 includes a series of new runtime features that can help you further optimize your website. Some of the new features can be used for SEO optimization to improve the ranking and weight of websites in search engines. These features include:
- New Page. MetaKeywords and Page. metadeworkflow attributes
- New URL-oriented support for ASP. NET Web Forms
- New Response. RedirectPermanent () method
The following describes how to use these features to further improve the relevance of search engines.
Page. MetaKeywords and Page. metadeworkflow attributes
A simple suggestion for improving the relevance of Web search is to make sure that you always output the related "keywords" and "description" in the
A good improvement in ASP. NET 4 Web Forms is that two new attributes are added to the Page class:MetaKeywordsAndMetadegionThey make it easier and cleaner to set these values by programming in the background code class.
The
The following is a simple code snippet that demonstrates how to set these attributes programmatically in the Page_Load () event handler function:
In addition to setting the Keywords and Description attributes in the background code, you can also set them in the declaration method in the @ Page command at the top of the. aspx webpage. The following code snippet demonstrates how to do this:
As expected, if you set these values programmatically, they will replace any value declared in the URL orientation in ASP. NET Web Forms
URL orientation is the first step in ASP. NET 3.5 SP1, which is already ASP. net mvc application, to show clean, SEO-friendly "web 2.0" URL. URL orientation allows you to configure an application to accept request URLs that are not mapped to physical files. You can use orientation to define URLs with more semantic meanings for users, these URLs help search engine optimization (SEO ).
For example, the URL of a traditional web page displaying product categories may look like this:
Http://www.mysite.com/products.aspx? Category = software
Using the URL-oriented engine in ASP. NET 4, you can now configure the application to accept the following URL to display the same information:
Http://www.mysite.com/products/software
In ASP. NET 4.0, URLs like above can now be mapped to ASP. net mvc controller classes, or to Web Pages Based on ASP. NET Web Forms. You can even have an application that contains both Web Forms and MVC controllers, using a single set of guiding rules to map URLs between them.
Response. RedirectPermanent () method
With the migration of time, it is extremely common to move webpages and other content between web applications, but it will lead to the accumulation of invalid links in search engines.
In ASP. NET, developers often use the Response. Redirect () method to convert requests from old URLs to new URLs. But what many developers do not realize is that Response. the Redirect () method sends an HTTP 302 Found (temporary redirection) reply, leading to excessive HTTP round-trips when the user attempts to access the old URL. General Search EnginesNoFollowing multiple redirection jumps means that using a temporary redirection will negatively affect your webpage ranking.
ASP. NET 4 introduces a newResponse. RedirectPermanent (string url)The secondary method can be used for HTTP 301 (permanent redirection) redirection. This will lead to identification of permanently retargeted search engines and other user proxies to save and use the new URL associated with the content. This will index your content and increase your search engine page ranking.
The following is an example of using the new Response. RedirectPermanent () method to redirect to a specific URL:
ASP. NET 4 has introduced newResponse. RedirectToRoute (string routeName)AndResponse. RedirectToRoutePermanent (string routeName)The secondary method can be used to perform temporary or permanent redirection through the URL-oriented engine. The following code snippet demonstrates how to send a temporary and permanent redirection to a named path registered in the URL-oriented system (this path accepts a category parameter ).
You can use the above path and method for URL Based on ASP. NET Web Forms and ASP. net mvc at the same time.
Conclusion
ASP. NET 4 contains numerous feature improvements to facilitate the construction of an exclusive SEO-oriented public website. You should be able to use these features to increase the user traffic on your website, hoping to directly or indirectly increase your income.