How to remove (.aspx) from ASP.NET web forms page url using Friendly URL package.

I will explain how to remove (aspx) extension from asp.net web forms pages like the url in MVC.

First you need to install the package from Nuget :
Install-Package Microsoft.AspNet.FriendlyUrls

Then go to Global.asax file , and add the following line to application start  :

void Application_Start(object sender, EventArgs e)
{
   RouteConfig.RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}

Now your asp.net web forms application url will be friendly without extension (aspx), not that both url with and without aspx will be working.



how to register friendly url package asp.net
friendly url asp.net web forms

Comments

Popular posts from this blog

Create (post) JIRA ticket (Issue) with rest API using C# ASP.NET

ASP.NET MVC - Load Partial View using ajax with progress indicator - Visual Studio 2013 MVC 5