Everyone knows there is a limit to the size of the query string, right? Well ok, maybe you didn’t – but there is. What that limit is depends on the browser. There is a lot of conflicting information out there on the magical Google. An RFC defines it, but no one really seems to pay attention to those anyhow. (Are you listening Microsoft, of course you are! =]). Anyhow, for IE, the query string length is usually around 2000 characters.
However, in most cases you’re better off using a form and posting your data up to the server side that way, as the limitations on data are so large you will likely not need to worry about them. Sometimes, query strings can also show your users just a little too much information – though I’m by no means a proponent of "security through obscurity" hiding a little bit more from your users will keep the curious ones a little more in check =).
When working with Mapguide Enterprise/Mapguide Open Source we need to grab some potentially massive XML strings from the MgMap object and pass these along to the server side for processing. Take the selection XML from the MgMap object, even a single entity selection can use a significant portion of the characters available in the query string. On top of that, passing this data via query string requires that the data be URL encoded, using even more of our precious query string characters.
On the server side, you can now access this data from ASP.NET using Request.Form, for example Request.Form("MapName") would give you the map name. Don’t forget when retrieving the selection XML to run that through Server.UrlDecode, or HttpUtility.UrlDecode.
As usual, any comments, bugs, or rotten fruit – send em my way. Enjoy!