开发者

Ajax call using large querystring value fails

I have a Ajax call using asp.net scriptmanager. Which behind the scene takes the data and adds it into url as query string and making get call. But when that data is very large it fails.

I think if i can 开发者_开发问答increase querystring maxwidth it will be resolve. How can i change maxquerystring size in asp.net.

Also error is not due to browser limitation as it's being thrown by server.

Service is WCF service exposed for ajax.

Error is

    Exception Type: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]
Exception: Buffer cannot be null.
Parameter name: buffer
Source: DefaultPage
Stack Trace: 

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

So here it forms url like http://site/ajax.svc?data=xxxxxxxxxxxxxxxxxxxx

Large mean it gets around 1000 character long.

Where can i set maximum allowed url size or something.

I understand this kind of data need to be submitted using post instead of get but that's how scriptmanager works so would like to get solution by extending this limit.


You could consider to use $.POST


The maximum length of a query string cannot be set programatically, it is determined by the the web server and browser that are involved in the request.

Check the Compatability Issues section of the Wikipedia entry for details and links to additional resources.

http://en.wikipedia.org/wiki/Query_string

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜