小编Edu*_*ard的帖子

无法加载资源:服务器响应状态为403(禁止)MVC 5

我试图通过源代码学习一些东西,但是当我尝试复制此代码时,却遇到了该错误。

我有一个查看索引,试图从另一个文件夹访问一些.cshtml模板。

@{
    ViewBag.Title = "Index";
}
<div ng-controller="inboxIndexCtrl">
    <div class="row">
        <div class="col-sm-1">
            <a ng-href="#/" id="InboxSubNav">Inbox</a>
            <hr />
            <a ng-href="#/sent" id="InboxSubNav">Sent</a>
            <hr />
            <a ng-href="#/create" id="InboxSubNav">Create</a>
        </div>
        <div class="col-sm-11">

            <div class="well" ng-view></div>

        </div>

    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

脚本:

var mail = angular.module('mail', ['ngRoute']);

mail.config([
    '$routeProvider', ($routeProvider) => {
        $routeProvider.when('/', {
            templateUrl: 'Templates/Incoming.cshtml'
        })
            // Registering path with controller relative to Inbox/Index
            // This part is similar to RouteConfig.cs in ASP MVC
            .when('/message/:id', {
                // Templates are located inside Inbox.
                templateUrl: …
Run Code Online (Sandbox Code Playgroud)

javascript asp.net-mvc jquery routing angularjs

3
推荐指数
1
解决办法
6万
查看次数

标签 统计

angularjs ×1

asp.net-mvc ×1

javascript ×1

jquery ×1

routing ×1