For Programmers: Free Programming Magazines  


Home > Archive > ASP > January 2007 > Help with the POST method









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with the POST method
gtg489w@gmail.com

2007-01-19, 6:56 pm

I'm having trouble reading data that i send to the server using ajax.
The call I'm making in the client-side javascript is:

fullProject.open("POST", url, false);
fullProject.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
fullProject.send('var1=' + projectData);

and I want to know how to grab that data using asp. The call that I've
been manipulating is

<%
response.write "data: " & request("var1")
%>

That hasn't been working, and all I've been receiving back is the
string "data: ". Any help would be greatly appreciated!!

Evertjan.

2007-01-19, 6:56 pm

wrote on 19 jan 2007 in microsoft.public.inetserver.asp.general:

> I'm having trouble reading data that i send to the server using ajax.
> The call I'm making in the client-side javascript is:
>
> fullProject.open("POST", url, false);
> fullProject.setRequestHeader('Content-Type','application/x-www-for
> m-urlencoded'); fullProject.send('var1=' + projectData);


Without the definition of fullProject I cannot say,
it seems probable that your clientside code is at fault.

> and I want to know how to grab that data using asp. The call that
> I've been manipulating is
>
> <%
> response.write "data: " & request("var1")
> %>
>
> That hasn't been working, and all I've been receiving back is the
> string "data: ". Any help would be greatly appreciated!!


"Not working" always needs a complete explanation.
like "16 amp. mains fuse blows" or: shows "data: $$$&^%$@"

However the ASP, if it is asp-vbs, looks workable although not safe.
Other request collection values could get in the way.

Try:

<%
response.write "data: " & request.form("var1")
%>

In general, do not try to invent the wheel in to places at the same time.
I would first make a simple <form method='post' and try out the ASP,
and if that works go for the clientside xmlhttp in javascript..

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com