Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the limitation of query string length or size.is this depends on browsers?.can i increase or decrease the query string sizes in my asp.net application?
Posted

hi ayyappa,

By default it 2048 characters.
We have an option to change querystring length in web.config file.
XML
<httpRuntime maxQueryStringLength="260" maxRequestLength="2048"/>


Refer this link:
http://www.boutell.com/newfaq/misc/urllength.html[^]
 
Share this answer
 
v2
Comments
Zoltán Zörgő 13-Apr-13 2:54am    
You have misinterpreted this setting: the query string length limit set here is 260. And if you change here, you have to look also here: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits, and you have to be prepared that your application won't work in some situations.
The query string limitation has nothing to do with asp.net. That one is really generous. There is no concrete limitation specified anywhere, but it can be limited in many places: browsers, proxies, web servers.... Please see this briefing: http://en.wikipedia.org/wiki/Query_string#Compatibility_issues[^]. I suggest you try to fit into 255 characters with the whole url.

There are many things you might consider if you want to shorten the query string, but you have to design carefully.
- The simplest one is using short field names
- Use some logic both on client and server side to compress the query string (on server side this might require complex routing)
- Use cookies (as some sort of state) for query string parts that can be treated as state in a context
But I suggest you consider this one first:
- Use POST for those situations (even links can be "converted" to post forms)
 
Share this answer
 
maximum 256 characters for query string in URL
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900