BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

FriendlyUrls – For ASP.NET WebForms

| by Roopesh Shenoy on Sep 11, 2012. Estimated reading time: 1 minute |

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. 

Rate this Article

Adoption Stage
Style

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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT