473,788 Members | 2,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

querystring length

I have an ASP page with a button and other things.
When the button is clicked, it executes a javascript function which does:

document.Form1. method = 'post';
document.Form1. action = "AnotherASPpage .asp?p1=" + allFields1 + "&p2=" +
allFields2 + "&p3=" + bVar;
document.Form1. submit();

allFields1 represents all the fields in category 1 that user has selected.
The fields are delimited by comma.
allFields2 represents all the fields in category 2 that user has selected.
The fields are delimited by comma.

The AnotherASPpage. asp is supposed to display the result in Excel spreadsheet.

I test it by selecting 15 fields in category 1 and it pops up a File
Download small window asking if I want to Open, Save, or Cancel the Excel
file. It shows an Excel name like abc.xls in the Name: section in that small
window. I can Save the file successfully.

But, when I select 16 fields in category 1, pops up a File Download small
window asking if I want to Open, Save, or Cancel the Excel file. But, it
doesn't show an Excel name like abc.xls in the Name: section in that small
window. It shows ..., id1%20AS%20... When I click Save, it gives error about
IE can't download ...&p3=...

It looks like the limit of the querystring in the URL is too long. But with
POST method the limit is huge and I'm no where near that limit.

I am thinking about using hidden variables to pass data from one page to
another but I can't because onclick of a button page1 invokes a javascript
function which submits AnotherASPpage. asp and thus doesn't know about the
hidden variables from page1.

Can someone please help? Thanks.

Aug 14 '08 #1
3 1927
displayname wrote:
I have an ASP page with a button and other things.
When the button is clicked, it executes a javascript function which
does:

document.Form1. method = 'post';
document.Form1. action = "AnotherASPpage .asp?p1=" + allFields1 +
"&p2=" + allFields2 + "&p3=" + bVar;
document.Form1. submit();

allFields1 represents all the fields in category 1 that user has
selected. The fields are delimited by comma.
allFields2 represents all the fields in category 2 that user has
selected. The fields are delimited by comma.

The AnotherASPpage. asp is supposed to display the result in Excel
spreadsheet.

I test it by selecting 15 fields in category 1 and it pops up a File
Download small window asking if I want to Open, Save, or Cancel the
Excel file. It shows an Excel name like abc.xls in the Name: section
in that small window. I can Save the file successfully.

But, when I select 16 fields in category 1, pops up a File Download
small window asking if I want to Open, Save, or Cancel the Excel
file. But, it doesn't show an Excel name like abc.xls in the Name:
section in that small window. It shows ..., id1%20AS%20... When I
click Save, it gives error about IE can't download ...&p3=...

It looks like the limit of the querystring in the URL is too long.
But with POST method the limit is huge and I'm no where near that
limit.

I am thinking about using hidden variables to pass data from one page
to another but I can't because onclick of a button page1 invokes a
javascript function which submits AnotherASPpage. asp and thus doesn't
know about the hidden variables from page1.
I don't understand the problem. In the form's onsubmit event, populate the
hidden elements with the required values. Forget about the querystring.

What's the problem?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 14 '08 #2


"Bob Barrows [MVP]" wrote:
I don't understand the problem. In the form's onsubmit event, populate the
hidden elements with the required values. Forget about the querystring.

What's the problem?
After user selects all the fields, there's need to have a way to tell the
program to query the data and display the result in Excel. The button is a
way to let the user do that.
Here's the sequence of events:
1) page1.asp is rendered
2) user selects some fields from page1 and click the button
3) can page1.asp sets some hidden variables to indicate which fields the
user has just selected at this point?
4) page1.asp redirects to AnotherASPpage which needs to know which fields
the user selected.
5) AnotherASPpage. asp queries the database for those selected fields and
displays the result in Excel.
6) user still sees page1.asp and doesn't see AnotherASPpage. asp at all.
Aug 14 '08 #3
Bob Barrows [MVP] wrote:
I don't understand the problem. In the form's onsubmit event,
populate the hidden elements with the required values. Forget
about the querystring.
What's the problem?
For one thing, hidden inputs can very much impact the length of the
querystring. The OP's red herring is setting the form method to "post",
while littering the action with name-value pairs. His script is, in effect,
reading the querystring.

The problem with using POST and returning an ASP document with ContentType =
"applicatio n/vnd.ms-excel" (or
"applicatio n/vnd.openxmlform ats-officedocument. spreadsheetml.s heet" if Excel
2007) is that Internet Explorer handles the response, determines that the
ContentType requires an external application, then hands over the URL (not
the response stream) to Excel. At this point, Excel knows nothing about the
original POST, and submits a new request with the querystring only. This can
be confirmed by reading the IIS logs.

Gecko Browsers have no such problem.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Aug 14 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6748
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string: popup.html?pImage=30_leilani_dowding_b_060.jpg&ordRef=1000&Title=Leilani Dowding using the QueryString function below, the pImage variable should be
2
6831
by: Marcin | last post by:
i want to pass XML data in querystring from one to another asp page. it is about 10000 characters long, i cannot use FORM because it is already nested in one. What i do is i have IFRAME and im passing some xml data in QUERYSTRING. It doesnt work somehow, im using javascript escape method to substitute escape characters, but most of characters are being truncated (about 300-500 left). Are there limits in querystring length? what else...
4
1625
by: Steve | last post by:
Hi All, This problem is really annoying me, as I am sure there is a simple solution to it. If I try to read a querystring value in the Page_Load event and that querystring does not exist I get the error: Object reference not set to an instance of an object
1
1576
by: Mark | last post by:
Hello Can anyone tell me how to check if a a querystring is present or not I.E. If request.querystring("key") is in the url or not because when i try to reference it in anyway and its not there I get an error there has to be an easier way then having to put all the checks in a try catch statement
4
25364
by: Guoqi Zheng | last post by:
On my application, I need to have different action based on the pass in query string. When the query string is not presented, I try to use If request.querystring("id") ="" THEN ...... This is what I did in trational asp, however if I did abov in ASP.NET, I always got an error of "Object reference not set to an instance of an object. " How should I solve the problem?
4
1747
by: DaveF | last post by:
I am looping threw the querySting with: foreach (string name in Request.QueryString) I have a problem with a '&' being in one of the values. How do I deal with this? page.asp?theVal=2&theVal2=aa&e overdue --
3
2621
by: hecsan07 | last post by:
I am a newbie in .NET. I am trying to collect the query string and paste it to the new url. The problem is I am not sure with the particular names of the query string elements are. How can I iterate through the QueryString collection and copy the values to the URL? Please help me with some code examples. HS
7
2537
by: fox | last post by:
Hi, Lacking javascript knowledge, I just realized why my project has a bug. I am using ASP to loop through a set of records while it creates URLs with a querystring that has a single value pair. This URL needs to open in a floating window if clicked. (this is for an administrator and so opening a small floater gives them more efficient access to the data that will be displayed). I now understand that because the ASP executes first, that...
0
10948
by: sirjohnofthewest | last post by:
This function will give you 100% control over the QueryString -- perfect for programmers who use QueryString manipulation a lot. I wrote this function when I kept having to change values of the QueryString and remove some, add some, etc., etc.. It takes four (4) parameters: oldUrl = the current QueryString you would like manipulated qsName = the name of the QueryField you would like to modify/remove/add newValue = the new value you...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.