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

我想用源代码学习一些东西,但是当我尝试复制自己这段代码时,我得到了该错误。加载资源失败:服务器响应状态为403(禁止)MVC 5

我有一个视图索引其中我试图从另一个文件夹访问一些.cshtml模板。

@{

ViewBag.Title = "Index";

}

Inbox


Sent


Create

脚本:

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: 'Templates/Message.cshtml',

controller: 'oneMessageCtrl'

}).when('/create', {

templateUrl: 'Templates/Create.cshtml',

controller: 'createCtrl'

}).when('/reply/:id', {

templateUrl: 'Templates/Reply.cshtml',

controller: 'replyCtrl'

}).when('/sent', {

templateUrl: 'Templates/Sent.cshtml',

controller: 'sentCtrl'

})

.otherwise({ redirectTo: '/' });

}

]);

_layout已包括NG-应用。另外Angular bundle在Jquery之前加载,并且这是通过localhost完成的。

版本我使用:

Angular 1.3.0-beta4

jquery-1.10.2

页面加载时,为第二它加载

当我将鼠标悬停在链接上方时,路径似乎很好。当我点击链接时,它将继续路径,但由于403错误而不会加载任何内容。

这里是一些链接:

http://localhost:49602/Messages/Index#/

http://localhost:49602/Messages/Index#/sent

http://localhost:49602/Messages/Index#/create

我的猜测是,我没有使用角/ jQuery的的正确版本还是我失去了一些包?

试图在浏览器中查看一个模板,并得到了另一个错误:与计算器的帮助

Server Error in '/' Application. This type of page is not served.

Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

Requested URL: /Messages/Templates/Create.cshtml

2016-06-16

Eduard

+1

你可以试试 >> http:// localhost:49602/Messages /#/ >> http:// localhost:49602/Messages /#/ sent >> http:// localhost:49602/Messages /#/ create –

+0

well我得到这个:'HTTP Error 403.14 - Forbidden Web服务器被配置为不列出这个目录的内容。' –

+0

我还添加了这个< /system.webServer>' –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值