ASP.NET MVC: The Story So Far…

4/24/2010 4:10 PM

My previous entry ended with my saying that I would be migrating Tombatron.com to the ASP.NET MVC framework. I figured that I’d post some lessons learned every now and then so that others can learn from my experiences. I’ve started working on the migration and I must say that I’m actually surprised at the progress I’ve been able to make in just a few hours. The biggest hurdle I had to jump over today was “Routing”...

 

The first rule when creating a controller is, don’t give the controller the same name as an existing folder in your project. For example, do not create a controller called “ContentController” if there is a folder named “Content” (which there will be by default) in the root (not in the “Views” or “Controllers”) folder. Doing so makes the MVC routing engine wet the bed. I was spinning on that issue for about an hour before I ran across the following forum thread: Custom route returns 404... It was a face palm moment indeed.

 

Also, if you plan on writing an MVC application with the slightest bit of complexity, do yourself a favor and check out the “ASP.NET Routing Debugger” by Phil Haack. It really does take the guess work out of determining why your custom routes don’t work (and at first they won’t).

 

Those are the two big “take away” items from today’s adventure with ASP.NET MVC. So far I’m still impressed.

loading...
Comment Entry


Twitterings - Follow Me

  • If you're looking for a kick ass regular expression tests check this out: http://bit.ly/2K8TKT
  •  
  • Saw an application that I work on being used by an end user today. Incredibly satisfying!
  •  
  • Lightning delay at the Bucs game... Welcome to Tampa!
  •  
  • Working on the website, finally got some basic twitter integration working...
  •  
  • If Rick Scott is elected governor, do you think he'll assert his 5th amendment right when taking the oath of office?
  •