Loading ...

Permanent Redirect in ASP.NET 4.0 ("HTTP 301 Moved Permanently”) | CodeAsp.Net

Permanent Redirect in ASP.NET 4.0 ("HTTP 301 Moved Permanently”)

 /5
0 (0votes)

In this blog I will show the new feature in .Net Framework 4.0  which facilitates Permanent Redirect in your application .Permanent Redirection is really important because over normal course of evolution of a website Paths/end names/directory name/domain name/page name they all tend to change. Every Page which is linked to that page is bound to give you error. So to overcome that problem we use permanent redirection .

 

In 4.0 there is new response method for redirecting a Request permanently.Let's take up a scenario , When we move a page to different location /different directory , it always requires to send “301 Moved Permanently” response to the search engines to keep back the page rank before redirecting to the new page.

 

In Pre 4.0  .Net Framework Era

Following is  code snippet to Permanent Redirection

 

 

In 4.0  .Net Framework  - There is new response method for redirecting a Request permanently.

Here is the code snippet- 

 4.0

 

 

Reference

·         You can see the MSDN documentation for Response.RedirectPemanent()

·         Check Out more new feature of .Net Framework 4.0   - Breaking Changes in 4.0 .

 

Conclusion

 .Net Framework 4.0  arrival has made coding even more simpler.

Comments (1)

   
Water Treatment Systems
It was just nice information sharing and its helpful for everyone.
3/22/2011
 · 
by
  • :*
  • :*
  • :
 *

Top Posts