Take the 2-minute tour ×

I will like add conventional HTML page under VIEWS folder (in ASp.NET MVC) page. I have added the route exceptions as mentioned below.


Although it does work when I put the html files out of VIEWS folder but I get Page not found 404 when I put those in VIEWS folder. I am also unable to browse the VIEWS folder by setting directory browsing option in IIS.

Please help me on HOW to access HTML file from VIEWS folder.

share|improve this question
add comment

2 Answers

I think that it's a mistake to mix your HTML content with your views. I'd suggest that you create a separate static folder under Content and put your HTML there. You can create an analogous directory structure to your view structure if necessary for management. Then you don't need to do anything special in order to able to reference the files. You can even, then, open them up to editing with Contribute, etc. by people who are allowed to modify static content.



 <a href='<%= Url.Content( "~/Content/Static/Account/privacy.html" ) %>'>Privacy Policy</a>
share|improve this answer
+1 for keeping Views folder strictly for Views. –  CoderDennis Jul 6 '09 at 23:08
add comment

The default Views folder has an Web.config file that explicitly gives 404 errors for all requests. You just need to edit and enable for HTML files (or all files, but then people might snoop).

share|improve this answer
add comment

Your Answer


