Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Is it possible to return '*.htm' files from the ASP.Net MVC4 Web API application?

I am trying to use AngularJs to manage the client side views and when I include the following commend on my page:

<div ng-controller="application.RootController">
    <div ng-switch="subview" >
        <div ng-switch-when="home" ng-include="'../Views/Angular/customer/overview.htm'"></div>
        <div ng-switch-when="admin" ng-include="'../Views/Angular/Admin/home.htm'"></div>
    </div>
</div>

I see that this is working as expected on the browser, but the ASP.Net is returning 404 page not found.

Also I am unable to physically browse any of the htm pages, so is there a special thing i need to do in ASP.Net MVC in terms of configuring the routing to return out the htm pages?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

Files in the ~/Views folder are not served directly. You should place your HTM pages somewhere else. For example you could have an ~/Angular folder.

share|improve this answer
    
wow! couldn't think about this one. Also had to include the "routes.IgnoreRoute(".htm");" and now it works. Thanks –  Kiran Nov 13 '13 at 10:33

your should place static files into '/static' folder

share|improve this answer
1  
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. –  Nalaka526 Nov 13 '13 at 10:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.