1

I have searched everything under the sun! It is driving me insane. I have set up a MVC 4.0 application on IIS 8.5 on windows 8.1 and getting 404 error when routing. Below is my routing defined:

routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}",
                defaults: new { action = RouteParameter.Optional }
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

i' ve added: runAllManagedModulesForAllRequests="true" in web.config but no use! i want controller/view to work e.g

<a href ='Controller/View'>Home</a>

the routing via

<a href='@Url.Action("View", "Home")'>Home</a>

this works but my angular module loading/routing fails! My angular is set up as below:

.config(function ($stateProvider, $urlRouterProvider) {
    $stateProvider
       .state(
        "main", {
            url: "/",
            views: {
                '': { templateUrl: '/Partials/MainTemp.html' },
                //Menu 
                'columnOne@main': {
                    templateUrl: '/Partials/Menu.html',
                    controller: 'menuCtrl'
                },
                //Page
                'columnTwo@main': {
                    templateUrl: '/Partials/MainPage.html',
                    controller: 'mainCtrl'
                }
            }

        })

Everything works fine in debug mode. Am i missing something very basic!

Newbie
  • 11
  • 2
  • Is your MVC project configured to serve up .html files? http://stackoverflow.com/questions/17949460/how-do-you-request-static-html-files-under-the-views-folder-in-asp-net-mvc –  Jun 08 '15 at 03:02
  • i have one home page -> controller/view href url does n ot work but @url() works - it points to a view (.cshml> which has angular setup - the .html are not in views folder but under scripts > module > partials. Following are my handlers in web.config: – Newbie Jun 08 '15 at 03:41
  • ` ` @user1 – Newbie Jun 08 '15 at 03:43

0 Answers0