I'm learning ASP.NET MVC (I mostly understand how it works), but I have a few questions about designing/organization your web sites.
1. When should you create a new controller and when should you just add a new action?
In the download, there's a HomeController that has Home, Contact, and About actions that interact with 3 different ASPX pages (almost said web forms). It seems like you could have had 3 different controllers here, but that would bring the Controller to ViewPage ratio to a 1:1.
When should you just add more to a single controller versus just making a new controller? How much is too much to put into one controller? Should it be divided up based on your Model/Data?
2. Where is a standard place to put UserControls?
I've created a top level directory ~/UserControls, but should this be under Views? Or Views/Section/UserControls? Is there a standard way for this?
3. Routing.
I tried messing around with adding a few new routes last night, but I kept getting my ActionLinks pointing to ~/Home (default route, I think). I switch from using routes.Map to routes.Add and it seemed to be working. Is there a way to use RegEx to reduce the number of routes in the global.asax file?
Right now, I have a bunch of routes for a blog like route:
/blog/
/blog/{year}/
/blog/{year}/{month}/
/blog/{year}/{month}/{day}/
/blog/{year}/{month}/{day}/{slug}
Then I need to add pagination support, so I needed to add:
/blog/page/{page}
/blog/{year}/page/{page}
/blog/{year}/{month}/page/{page}
/blog/{year}/{month}/{day}/page/{page}
Is there a better way for this?
Thanks,