MVC4 PartialViewResult return a view and not a PartialView

I have an LogInOrRegister page in my application, that calls 2 child actions LogInOrRegister.cshtml @{ ViewBag.Title = "Log in"; } @Html.Action("Login", "Account", new { returlUrl = ViewBag.ReturnUrl}) @Html.Action("Register", new { returlUrl = ViewBag.ReturnUrl}) @section Scripts { @Scripts.Render("~/bundles/jqueryval") } The Login PartialView is: @model Com.WTS.Portal.Models.LoginM

MVC4 PartialViewResult返回一个视图而不是PartialView

我的应用程序中有一个LogInOrRegister页面,它调用2个子操作LogInOrRegister.cshtml @{ ViewBag.Title = "Log in"; } @Html.Action("Login", "Account", new { returlUrl = ViewBag.ReturnUrl}) @Html.Action("Register", new { returlUrl = ViewBag.ReturnUrl}) @section Scripts { @Scripts.Render("~/bundles/jqueryval") } 登录PartialView是: @model Com.WTS.Portal.Models.LoginModel <hgroup class="titl

Pass viewbag to partial view from action controller

I have a mvc view with a partial view.There is a ActionResult method in the controller which will return a PartialView. So, I need to pass ViewBag data from that ActionResult method to Partial View. This is my Controller public class PropertyController : BaseController { public ActionResult Index() { return View(); } public ActionResult Step1() { ViewBag.He

将viewbag传递给动作控制器的局部视图

我有一个带有局部视图的mvc视图。控制器中有一个ActionResult方法,它将返回一个PartialView。 所以,我需要从该ActionResult方法传递ViewBag数据到Partial View。 这是我的控制器 public class PropertyController : BaseController { public ActionResult Index() { return View(); } public ActionResult Step1() { ViewBag.Hello = "Hello"; return PartialView(); } }

Forms Authentication & authorization MVC 4

I'm trying to create an anonymous controller in order to acheive form authentication. I configured my IIS 7 with anonymous and form authentication enabled and set my web.config to deny anonymous users. On the login controller I put the [AllowAnonymous] decoration on my controller (and my actions). The only action I can get on this set of configuration is the login action (which returns th

表单认证和授权MVC 4

我正在尝试创建一个匿名控制器以获得表单身份验证。 我使用匿名和表单身份验证启用了我的IIS 7,并将我的web.config设置为拒绝匿名用户。 在登录控制器上,我将[AllowAnonymous]装饰放在我的控制器上(和我的操作)。 我可以在这组配置上获得的唯一操作是登录操作(它返回“登录”视图),并且我猜测MVC允许我获取此操作,因为我将它设置为我的Web上的登录URL的.config。 这是我的网络配置配置: <authentication mo

How to configure the web.config to allow requests of any length

I am building a site in which i would like to create a file client side from the value of a textarea element. I have the code in place to do this, but i am getting this error HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long. Is there a way to override this so that I am able to process requests of any size? If not

如何配置web.config以允许任意长度的请求

我正在建立一个网站,我想从textarea元素的值创建一个文件客户端。 我有代码来做到这一点,但我得到这个错误 HTTP错误404.15 - 未找到请求过滤模块配置为拒绝查询字符串过长的请求。 有没有办法来覆盖这个,以便我能够处理任何大小的请求? 如果没有,是否有办法生成文件客户端而不使用filesystem / active x对象? 谢谢 将以下内容添加到您的web.config中: <system.webServer> <security> <

Base64 string is too long

I have made webservice to receive base64string and image name from android app . but the problem is when i pass a value of base64string into webservice i get an error </style> </head> <body> <div id="content"> <div class="content-container"> <h3>HTTP Error 404.15 - Not Found</h3> <h4>The request filtering module is configured to deny a

Base64字符串太长

我已经使web服务从android应用程序接收base64string和图像名称。 但问题是,当我将base64string的值传入webservice时,出现错误 </style> </head> <body> <div id="content"> <div class="content-container"> <h3>HTTP Error 404.15 - Not Found</h3> <h4>The request filtering module is configured to deny a request where the query string is too long.<

Why is my query string so long?

I am using MVC 5, and just now got the following message: "The request filtering module is configured to deny a request where the query string is too long." Why is my query string so long? Notice how it repeats the same information over-and-over. I am currently trying to default the [Authorize] using Global Filtering, but I haven't altered anything in the WEB.CONFIG...What wo

为什么我的查询字符串很长?

我正在使用MVC 5,并且刚刚收到以下消息: “请求过滤模块被配置为拒绝查询字符串太长的请求。” 为什么我的查询字符串很长? 注意它是如何重复地重复相同的信息。 我目前正在尝试使用全局过滤来默认[Authorize],但是我没有改变WEB.CONFIG中的任何内容......这会导致什么? QUERY STRING LOKS LIKE: 本地主机:80 / yourapplication /帐户/登录RETURNURL =%2Fyourapplication%2Faccount%2Flogin%3FReturnUrl%3D

ASP.NET MVC Windows Authentication refusing to work

I've created a MVC Web Application using Visual Studio 2015. My goal is to change the authentication mode from none to Windows Authentication as I need so I can use the @User.Identity.Name method to identify the user. A short summary of what I've tried so far: Project Properties set Anonymous Authentication: disabled set Windows Authentication: enabled Web.config adding maxUrlL

ASP.NET MVC Windows身份验证拒绝工作

我已经使用Visual Studio 2015创建了一个MVC Web应用程序。我的目标是将身份验证模式从none更改为Windows Authentication,因此我可以使用@ User.Identity.Name方法来标识用户。 以下是我迄今尝试过的简短摘要: 项目属性 设置匿名身份验证:禁用 设置Windows身份验证:启用 Web.config文件 向httpRuntime标记添加maxUrlLength =“65536”属性 向httpRuntime标记添加maxQueryStringLength =“10240”属性 在<syste

Error : http query string is too long

我在mvc中使用下面的代码来下载Excel文件,但它显示错误查询字符串太长。 public ActionResult Download(string input) { Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("Content-Disposition", "attachment; filename= download.xlsx"); Response.AddHeader("Content-Type", "application/Excel"); Response.ContentType = "app

错误:http查询字符串太长

我在mvc中使用下面的代码来下载Excel文件,但它显示错误查询字符串太长。 public ActionResult Download(string input) { Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("Content-Disposition", "attachment; filename= download.xlsx"); Response.AddHeader("Content-Type", "application/Excel"); Response.ContentType = "app

web.config maxJsonLength issue

I try to send large message json(with images) using HttpClient.PostAsJsonAsync from one side and try get data in Controller using Microsoft.AspNet.Mvc version="5.2.3". When I send small messages everything is okey. Move code details: private async Task<HttpResponseMessage> Method<TRequest>(string url, TRequest request, IEnumerable<KeyValuePair<string, stri

web.config maxJsonLength问题

我尝试从一侧使用HttpClient.PostAsJsonAsync发送大型消息json(带图像),并尝试使用Microsoft.AspNet.Mvc version =“5.2.3”在Controller中获取数据。 当我发送小消息时,一切都是安全的。 移动代码详情: private async Task<HttpResponseMessage> Method<TRequest>(string url, TRequest request, IEnumerable<KeyValuePair<string, string>> headers) { using (var clien

Can't set maxJsonLength

I'm getting this error: Internal Server Error: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. I have googled answers for this and have found 2 answers, neither of which seem to be working for me. I have tried to add the maxJsonLength setting to the web.config but it's be

无法设置maxJsonLength

我收到这个错误: 内部服务器错误:在使用JSON JavaScriptSerializer进行序列化或反序列化期间出错。 字符串的长度超过maxJsonLength属性中设置的值。 我已经搜索了这个答案,并找到了2个答案,这两个答案似乎都不适合我。 我试图将maxJsonLength设置添加到web.config,但它被忽略。 另外,我尝试在C#代码中设置MaxJsonLength = int.MaxValue; 但我使用MVC 2.0,它似乎只适用于MVC 4? 任何人都可以帮助我正确设置maxJ