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?
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?
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.
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.
If you are using IIS7, go with the URL Rewrite Module.
I used it for one of my sites, and it worked perfectly.
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.
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.