April 2008 - Posts

ASP.NET MVC - Legacy Url Routing
25 April 08 07:54 AM | mhawley | 1 comment(s)

Recently, we've been converting over a lot of our ASP.NET Web Form pages to use ASP.NET MVC. While this is no small feat by itself, the underlying problem of having a new Url structure in the site while still supporting legacy Url's was necessary. The idea, is that you hit a page that no longer exists, and you get redirected to the appropriate controller & action within MVC.

Workflow

  1. A legacy Url is requested from your site. For example, http://www.server.com/Users/Login.aspx
  2. ASP.NET routing intercepts the request and matches a route from your route collection
  3. Instead of using the MvcRouteHandler, a LegacyRouteHandler is invoked.
  4. Using the LegacyRouteHandler, it'll use the route redirection name you specified, generate the MVC Url, and issue a HTTP 301 with the location of http://www.server.com/site/login.

Read more...

Filed under: , ,
ASP.NET MVC - ActionResult... The Good & Not So Bad
19 April 08 03:56 AM | mhawley | with no comments

I'm thoroughly enjoying the new ActionResult feature the ASP.NET team introduced into the "refresh" of the Preview 2 bits... or whatever they're calling it now :) Introducing this has increased productivity regarding testing the results of a controller's action. Here's a quick summary of the different types... Read More

Filed under: ,
More Posts

This Blog

News

.NET Links

Blogs I Read

Syndication