Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AJAX Post and ASP

Status
Not open for further replies.

theniteowl

Programmer
May 24, 2005
1,975
US
Hi All,
Using xmlHTTP to send data to an ASP page, is it possible to read the passed data other than on the querystring?
Just wondering about limitations on the length of the data sent.


At my age I still learn something new every day, but I forget two others.
 
niteowl, dunno if you got your answer or not - but you use the send method to pass the data with the post method:

Code:
xmlhttpObj.open([!]"POST"[/!], url, true);
xmlhttpObj.send([!]"blah=someValue&blah2=someOtherValue"[/!]);

The values and value names for the send method are basically built the same way you would build a querystring - seperated by a & character.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Hi kaht,
What you show above is the way I am currently sending.
I am wondering about limitations imposed by passing data along the querystring and if there is another method that would not have the same limitations.
If I had a lot of variables or a large block of text to send the querystring would max out quickly.
Any alternatives?


At my age I still learn something new every day, but I forget two others.
 
The post method still uses the querystring? I'll admit that I've not had a need to pass info via post - I've always used the get method instead. I assumed that this method would not pass the info in the querystring......

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Well, since the request is made in the background I do not actually see the querystring but in my ASP page I have to use Request.QueryString("myvalue") to retrieve the values.
Request.Form() did not return values when I tested.

I was hoping there would be another method but nothing I have read indicates it. So xmlHTTP is limited in the amount of information I can pass from Javascript.


At my age I still learn something new every day, but I forget two others.
 
Request.Form() did not return values when I tested.

Hmmm... that's interesting. That would indicate that it is not a POST submission at all in my opinion. Odd that they would use POST terminology when it's not really a post submission.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
i had always understood that it was a true POST of the data (i.e. not via the GET method).

this should be pretty easy to discern one way or another: either look at your webserver logs or load up ethereal and examine the packets.

in php i always use $_POST to grab the vars sent my an AJAX script using the POST method (purportedly). this, to me, is good evidence that it is a genuine POST
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top