Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News FriendlyUrls – For ASP.NET WebForms

FriendlyUrls – For ASP.NET WebForms


FriendlyUrls is a new ASP.NET feature that allows developers to easily use pretty urls in their web forms applications. It also makes it easier to manage both Mobile and Desktop views in the same project, similar to MVC. Scott Hanselman explains more.

How do you use this package? Just add the nuget package to the project, call routes.EnableFriendlyUrls() and your /Foo.aspx will be available at the /Foo route! You can also use Url segments to pass more information to the page (/Foo/bar/34) and then retrieve it using Request.GetFriendlyUrlSegments() method for use in the Foo.aspx page. 

Some more exciting features Scott shows -

  • Automatic switching to mobile-specific views if the request comes from a mobile device
  • Ability to customize behaviour by extending the WebFormsFriendlyResolver class – for e.g. to add device-specific handling

Scott emphasizes how this is just one more step in the grand One ASP.NET plan that is getting evolved over time. We have already noted how the productivity gap between Web Forms and MVC is getting reduced with the .NET 4.5 release.

Note that FriendlyUrls is still in alpha, mainly out to elicit more feedback from developers. It does however work with both .NET 4.5 and .NET 4.0, so you can use it with your existing .NET 4 applications as well. 

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.