Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2004, 05:50 AM
Authorized User
 
Join Date: Jul 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query String Size


What is the max size of a query string allowed?

Is there a limit imposed by the Http protocol?



 
Old July 21st, 2004, 07:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

There is a limit using querystring values but I can't remember the exact size. That's why ASP.NET uses the POST method that allows more data to be passed back to itself (since ASP.NET POSTs to the same page).

 
Old July 27th, 2004, 08:40 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe it's 255 characters.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old July 27th, 2004, 11:01 AM
Registered User
 
Join Date: Dec 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's more than 255 characters. At my previous job we were concerned about hitting the limit (we overused the qs, you could say) and losing data. We tested it to, and above, 2k of text.

But -- I think older browsers may truncate at 2k. Be careful with those.

For an example of huge qs's, look at any RealNetworks product's order path.

 
Old August 1st, 2004, 12:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

as Colonel since ASP 3.0 I do believe it's 255 characters or .Net removed the limiration I diudnt test this time.

Always:),
Hovik Melkomian.
 
Old August 1st, 2004, 04:36 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No way. It's much longer than 255 characters, and that was also the case in classic ASP. I don't even think it's a server side problem, but a browser restriction. Here's a simple test.
Create two pages, QueryString1.asp and QueryString2.asp. In the first, add the following code that creates a string of 2000 characters, appends it to an URL as a QueryString and then redirects to that:
Code:
<%
  Dim queryString
  Dim loopCount

  For loopCount = 1 To 2000
    queryString = queryString & Right(CStr(loopCount), 1)
  Next
  Response.Redirect("QueryString2.asp?QUERY=" & queryString)
%>
On QueryString2.asp add code that writes out the QueryString and its length:
Code:
<%
  Response.Write("The QueryString is " & _
      Request.QueryString & "<br />")
  Response.Write("It has a length of " & _
      Len(Request.QueryString) & "<br />")
%>
When you open QueryString1.asp in your browser, you'll see it successfully redirects to QueryString2.asp where it displays the QueryString and a length of 2006 (QUERY= is counted as well).

In Internet Explorer, I can loop up to 2034 so the entire QueryString is 2040 characters. After that, the code stops working.
However, other browsers have different limitations. In FireFox 0.X I can successfully pass QueryStrings of 6000 characters and more (haven't tested the upper limit yet).

The same is True for Opera 7 (5 and 6 show the correct length, but no longer display the QueryString), Netscape (4, 6 and 7) and Mozilla.

So since Internet Explorer 6 is one of the most used browsers, it's recommended to keep the length of the QueryString under 2000 characters.

Hope this clarifies the QueryString myth a little bit.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Creamer (Radio Is Dead) by Limp Bizkit (Track 13 from the album: Results May Vary) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 97 Query Size Limit chubnut Access 2 October 20th, 2008 04:07 AM
sql query builder windw size problem the_dude ASP.NET 2.0 Basics 0 January 25th, 2007 01:37 PM
relative size query noam Access 4 December 12th, 2005 06:00 PM
Limit the Size of String Input phungleon Classic ASP Databases 3 May 4th, 2005 11:31 PM
Query String Nitin_sharma VBScript 1 December 16th, 2004 07:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.