对于jQuery发布到asp.net页面错误:此请求的查询字符串的长度超过配置的maxQueryStringLength值感兴趣的读者,本文将提供您所需要的所有信息,并且为您提供关于asp.net–为
对于jQuery发布到asp.net页面错误:此请求的查询字符串的长度超过配置的maxQueryStringLength值感兴趣的读者,本文将提供您所需要的所有信息,并且为您提供关于asp.net – 为什么Request.QueryString只读?、asp.net-mvc – ASP.NET MVC – 向ActionLinks添加querystring“length =”?、asp.net-mvc-4 – 为什么超过指定maxRequestLength的请求会响应(看似)不相关的错误?、c# – 字符串的长度超过maxJsonLength属性上设置的值的宝贵知识。
本文目录一览:- jQuery发布到asp.net页面错误:此请求的查询字符串的长度超过配置的maxQueryStringLength值
- asp.net – 为什么Request.QueryString只读?
- asp.net-mvc – ASP.NET MVC – 向ActionLinks添加querystring“length =”?
- asp.net-mvc-4 – 为什么超过指定maxRequestLength的请求会响应(看似)不相关的错误?
- c# – 字符串的长度超过maxJsonLength属性上设置的值
jQuery发布到asp.net页面错误:此请求的查询字符串的长度超过配置的maxQueryStringLength值
The length of the query string for this request exceeds the configured maxQueryStringLength value.
它适用于小内容.但是当内容很大时,它会抛出一个错误
这是我的javascript代码
var content1 = $("#txtAdminLabelEdit"+id).val(); content = encodeURIComponent(content1); var url = "handlers/adminhandler.aspx?mode=savecontent&page=home&lid=1&vid=2<xt=" + content; $.post(url,function (data) { if (data == "yes") { //do something } });
解决方法
<httpRuntime maxRequestPathLength="360" maxQueryStringLength="1024" />
asp.net – 为什么Request.QueryString只读?
但是这段代码对我有效:
Request.QueryString edit
我很惊讶.
以下是我对此的疑问:
>为什么Request.QueryString只读?
>为什么这个代码/黑客工作*?
>如果您在完成编辑后立即更改为只读,包括错误错误或意外行为,以及维护和理解代码,它的安全性如何?
>如果您只使用PageLoad和OnPageRender,那么在事件周期中哪里做最疯狂的编辑是最有意义的?
*更多细节:
我有一个页面,其中包含分组到选项卡的项目.每个选项卡都是一个asp:LinkButton
我希望能够直接链接到特定选项卡.我使用QueryString参数’tab = tabName’来做到这一点.有用.但是当我单击一个新选项卡时,查询字符串仍然在Url中,因此Querystring中指定的选项卡被激活,而不是我单击的选项卡.
通过使用Request.QueryString edit,这不会发生.然后我的解决方案“有效”.
提前致谢.
解决方法
如果您希望选项卡使用URL,请使用超链接而不是LinkButton.
asp.net-mvc – ASP.NET MVC – 向ActionLinks添加querystring“length =”?
解决方法
Html.ActionLink("Title","Action","Controller",null,new { title = "Title"} )
发布你的代码,如果这不工作。
asp.net-mvc-4 – 为什么超过指定maxRequestLength的请求会响应(看似)不相关的错误?
<location path="File/Upload"> <system.web> <httpRuntime maxRequestLength="330"/> </system.web> </location>
在测试超过330kb的文件上传时查看网络选项卡时,我可以看到服务器的响应为500,详细信息为所需的防伪表单字段& quot; __ RequestVerificationToken& quot;不在场.
为什么会这样?框架是否无法在响应中提供maxRequestLength的详细信息?或者它只是不想为了不泄露有关系统的信息?
或者是我的请求被截断/裁剪以满足限制,这无意中削减了请求验证令牌?
注意
这适用于不超过330kb的文件,我的上传工作.
解决方法
此值遵循以下规则:
1 Mb = 1024kb
你可以在以下网址看到更多细节:
https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength(v=vs.110).aspx
因此,当您设置maxRequestLength =“330”时,系统将理解文件上载限制为330kb.
c# – 字符串的长度超过maxJsonLength属性上设置的值
The length of the string exceeds the value set on the maxJsonLength property.
我已将maxJsonLength属性更改为2147483644,但它仍然无效.请帮忙……谢谢.
<system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="2147483644"/> </webServices> </scripting> </system.web.extensions> [WebMethod] [ScriptMethod(UseHttpGet = true,ResponseFormat = ResponseFormat.Json)] public void GetData(string login) { // throw an error on this line... string result = new JavaScriptSerializer().Serialize(service.GetData(login)); Context.Response.Write(result); }
解决方法
[WebMethod] [ScriptMethod(UseHttpGet = true,ResponseFormat = ResponseFormat.Json)] public void GetData(string login) { // when the amount of data return is huge var serializer = new JavaScriptSerializer(); // we need to do this. serializer.MaxJsonLength = Int32.MaxValue; var result = serializer.Serialize(service.GetData(login)); Context.Response.Write(result); }
我们今天的关于jQuery发布到asp.net页面错误:此请求的查询字符串的长度超过配置的maxQueryStringLength值的分享就到这里,谢谢您的阅读,如果想了解更多关于asp.net – 为什么Request.QueryString只读?、asp.net-mvc – ASP.NET MVC – 向ActionLinks添加querystring“length =”?、asp.net-mvc-4 – 为什么超过指定maxRequestLength的请求会响应(看似)不相关的错误?、c# – 字符串的长度超过maxJsonLength属性上设置的值的相关信息,可以在本站进行搜索。
本文标签: