I’m setting up a new project and would like to have some tips about it so it will be done right from the start.
Simply put, this is my project:
-
There will be some about/info pages: about us, contact, how to.. Is it good practice to then create a AboutController or should i make seperate controllers for each page?
-
There will be a member area which needs login. Is it a good idea to create an Area for this?
Maybe like: xxx.com/member/stuff/edit/1 -
Would I then need to create a “general” Area or could i just put “About” in the root, like this: xxx.com/about/contact instead of xxx.com/general/about/contact ?
-
What about master pages. The page will look very much alike when logged in, and when not. Is it good practice to have two master pages for this and try to reuse code (like the footer and menu) with partials?
-
I’ve only worked a little bit with MVC 2, is it stupid to not go with MVC 2 RC for a brand new project like this?
Any answers or advice is highly appreciated.
Thank you
I usually have a Home or About (or both) Controller that houses these pages. Separate controllers are not usually necessary. In most of my sites these are almost all static content pages that do not accept POST, so the controllers are very thin anyway.
This decision is quite subjective. I would suggest that if you don’t have a clear understanding when and why you want an area, then don’t use one. Also, if the only area’s your application has our logged-in members and not, then it seems like Areas are not needed.
In the root, that is the “general” area.
I do not use two masters for this situation. All that changes for most of my sites is some header content (presence of log in or log out link).
What I do instead is create an Html Helper to conditionally render one control or another:
MVC 2? How about MVC 3? MVC 3 was released recently. It includes the Razor view engine, and because of that I would say it is definitely worth using. I see no reason not to use MVC3 for a new project.