我在登录页面,css文件和js文件中有一些包含.
<link rel="stylesheet" type="text/css" href="../../ext/resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext/bootstrap.js"></script>
Run Code Online (Sandbox Code Playgroud)
不幸的是,浏览器为这些请求获得了302响应.Forms Auth将请求视为未经授权并将其重定向到登录页面.它没有意识到请求首先来自登录页面.
GET http://localhost:50880/ext/resources/css/ext-all.css HTTP/1.1
HTTP/1.1 302 Found
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/Account/LogOn?ReturnUrl=%2fext%2fresources%2fcss%2fext-all.css">here</a>.</h2>
</body></html>
Run Code Online (Sandbox Code Playgroud)
我想也许设置包含文件夹(ext)的权限可能对每个人都有帮助.
我在其他项目中没有遇到过这个问题.