Intelliwins Blog

Anything you wanna know about?

Seo Friendly URL Redirection On Web Forms

by Admin 21. September 2013 14:06
On 3.5 sp1 onward microsoft has given facility for URL Routing . You just have to include few codes into Global.asax. After URL Routing Your URL Will look more human and search engine friendly. If you URL is  it will look like . Extension less and SEO Friendly . For that we have to add Global.asax into our project . Then import System.Web.Routing   <%@ Import Namespace="System.Web.Routing" %>  Then we have to write code for URL redirection inside Global.asax.   void registerroute(RouteCollection routes) { routes.MapPageRoute( "Home-Route", "Home", "~/Default.aspx" ); }  This is for Static Pages with out query strings. For Webpages with query string like   The code would be: routes.MapPageRoute( "Page-Route", "Pages/{page}", "~/page.aspx" );The New Seo Friendly URL looks like To access the attached query string string pg = Page.RouteData.Values["page"] as string; Hope this will solve one of the biggest headache for web forms . Happy Coding !!!!  

Tags: , , | Url redirection

Brit Colony, Bhubaneswar,India +91 94384 80191 info@

About Us

Intelliwins mission is to alter the dynamics of the software industry by providing trusted, supportive and quality software development servies to clients that view our partnership as a strategic driver for their success.


Enter your email to join our mailing list