Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net MVC and normal html pages

Tags:

asp.net-mvc

I'm about to create quite simple website which will contain several static pages (they will never change) and one dynamic change (let's call it news). I'was wondering whether it's possible to use MVC here without having to create controllers and views for these "static" pages. Isn't that just too much overhead?

Is there a way to make MVC simply route incoming requests to valid documents without actually having to create controller?

like image 497
IamDeveloper Avatar asked Aug 12 '09 18:08

IamDeveloper


1 Answers

Just put your static content in a separate directory and link to it there. ASP.NET will simply serve up the static content as normal when the path is to a actual file. I created a static folder in my Content folder, but you could put it anywhere. The files could even live in the root of the site.

   +-Content
     +-images
     +-static
       +-about.html
       +-info.html
     +-styles
       +-site.css
       +-themes
        ...
like image 148
tvanfosson Avatar answered Oct 01 '22 04:10

tvanfosson