在ASP.net MVC单页应用程序中删除身份验证 [英] Remove authentication in ASP.net MVC single page application
问题描述
我正在尝试在Visual Studio 2013中使用asp.net MVC SPA模板,我不需要任何身份验证位,我只需要直接加载到控制器页面之一上即可.
I am trying to play about with the asp.net MVC SPA template in visual studio 2013, I don't need any of the authentication bits, I just need to load directly onto one of the controllers pages.
如何摆脱初始模板中的所有身份验证内容?
How do I get rid of all the authentication stuff from the initial template?
推荐答案
从HomeController
删除[Authorize]
批注,并将其删除:
Remove the [Authorize]
annotation from HomeController
and remove this:
@section Scripts{
@Scripts.Render("~/bundles/knockout")
@Scripts.Render("~/bundles/app")
}
来自Views\Home\Index.cshtml
的
,因为即使从HomeController
中删除了[Authorize]
注释,并且js
之一仍导致重定向到登录页面,并且可能不需要.如果您的页面中需要这些脚本,则需要编辑其中之一.
from Views\Home\Index.cshtml
because one of does js
is causing the redirect to the login page even after removing the [Authorize]
annotation from HomeController
and probably you don't need it. If you need these scripts in your page, then you need to edit one of them.
这篇关于在ASP.net MVC单页应用程序中删除身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!