简体   繁体   English

返回View()并返回PartialView()之谜MVC5

[英]return View() and return PartialView() mystery MVC5

I'm using MVC 5 with Identity 2.0 for security. 我将MVC 5与Identity 2.0结合使用以确保安全。 When I start the application it displays login page (without layout probably because I'm returning partial view). 当我启动应用程序时,它会显示登录页面(没有布局,可能是因为我要返回部分视图)。 When I use return View() instead of return PartialView() it gives me following error; 当我使用return View()而不是return PartialView()时,出现以下错误;

HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long. HTTP错误404.15-找不到请求过滤模块配置为在查询字符串过长的情况下拒绝请求。

I enabled both windows and Anonymous authentication of website but it is not working. 我同时启用了Windows和网站的匿名身份验证,但是它不起作用。 My action for login is 我的登录操作是

 [AllowAnonymous]
 public ActionResult Login(string returnUrl)
 {
     ViewBag.ReturnUrl = returnUrl;
     return PartialView();
 }       

your issue it's not the MVC code it's more an IIS configuration take a look at the following link 您的问题不是MVC代码,而是IIS配置,请查看以下链接

http://www.iis.net/configreference/system.webserver/security/requestfiltering/alwaysallowedquerystrings http://www.iis.net/configreference/system.webserver/security/requestfiltering/alwaysallowedquerystrings

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM