views:

726

answers:

5

I'm just wondering, if you are creating a new ASP.NET web forms app in ASP.NET 3.5, which would you recommend for URL rewriting? UrlRewriter.NET or ASP.NET MVC Routing. I've used UrlRewriter.NET before and was pretty happy with it.

Opinions anyone?

+2  A: 

Use UrlRewriter.NET - it was built for web forms and you already have experience with it and like it. ASP.NET MVC routing is designed to work within the MVC pattern.

Andrew Hare
@Andrew. I know it was built for ASP.NET MVC, but I've read a couple of articles that you can use the routing engine that's why I was asking is all. Just curious if anyone had experience using it in web forms and if it was a good fit.
nickyt
+2  A: 

Routing is vastly superior IMHO. Rather than faking it (rewriting urls to keep the SEO types happy) you are making it (making real urls to keep the SEO types happy). The other huge advantage is that routing is reversable--you can easily get the URL from the parameters, which comes in very handy.


No, they do vastly different things. The url rewriting takes an incoming url and rewrites it before passing the request off to ASP.NET (or IIS) to handle. Url routing takes a url in ASP.NET and maps a handler using parameters found within the Url. The Url itself is never changed.

Wyatt Barnett
@Wyatt, what do you mean faking it? I thought they did the same thing.
nickyt
I'll try the routing and see how she goes. Thanks.
nickyt
+1  A: 

If you are using IIS7, go with the URL Rewrite Module.

I used it for one of my sites, and it worked perfectly.

Martin
A: 

ASP.NET 4.0 web forms (I believe that it was introduced in 3.5 SP1) has routing build in natively. It has the benefit over rewriting modules that it is build in natively in the ASP.NET frameworks, and therefore does not need hacks to work correctly.

So you shouldn't go for MVC just because of the routing.

Pete
+1  A: 

Why not just go with Asp.Net MVC and ditch the webform methodology altogether? I realize that the framework isn't for everybody, especially for pre-existing projects, but if you are starting to develop a new app and are shopping for a routing mechanism, why not go for the framework that is built upon the notion?

Asp.Net MVC is a vastly superior framework over WebForms, it just requires a bit more upfront work and has a learning curve. At the end of the day though, you'll generally end up with an application that is much easier to expand and maintain.

Chance