sterix24
sterix24

Reputation: 2400

Building a simple site using ASP.Net MVC 3

I'm using mvc3 to build a simple site with 5 static pages. I'm just wondering what the best practice is in this situation. So far I have only one 'Page' Controller which has 5 functions, each returning the appropriate view.

I've also updated the global.asax file to use:

routes.MapRouteLowercase(
    "Default", // Route name
    "{action}/{id}", // URL with parameters
    new { controller = "Page", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);

I realise that the general rule is use one controller for each logical unit so I figure this works out okay for a small site?

Is this a suitable approach or should I do it differently?

Thanks.

Upvotes: 2

Views: 235

Answers (1)

Jakub Konecki
Jakub Konecki

Reputation: 46008

Your approach is fine.

However, if you have just static pages, why do you use MVC at all? You can just deploy a bunch of .html files and be done with it.

Upvotes: 2

Related Questions