Hi All,
I am sorry I have to make my first repost as a request, but I am in desperate measures. I just converted my shopping cart with AJAX, and it works perfectly, except the checkout button. I know I cannot use Response.Write within an AJAX application, but could someone tell me how I would bypass if I use:
byte[]data=Encoding.ASCII.GetBytes(postData);
HttpWebRequestppRequest=(HttpWebRequest)WebRequest.Create("https://www.paypal.com/cgi-bin/webscr");;
ppRequest.Method="POST";
ppRequest.ContentType="application/x-www-form-urlencoded";
ppRequest.ContentLength=data.Length;
//Send
StreamppStream=ppRequest.GetRequestStream();
ppStream.Write(data,0,data.Length);
ppStream.Close();
//Receive:¬(
HttpWebResponseppResponse=(HttpWebResponse)ppRequest.GetResponse();
StreamReadersr=newStreamReader(ppResponse.GetResponseStream());
stringstrResult=sr.ReadToEnd();
sr.Close();
//Writetoscreen
Response.Clear();
Response.Write(strResult);
Response.End(); The button that raises this event is within the updatepanel, and it simple writes out the paypal checkout form on the page. I would love to get this going as it has been so simple so far. I have tried the ScriptManager class but no luck here, as I want to literry redirect with my PostDta.
So if anyone can offer an alternative that would be much appreciate, and if anyone wants sample code I am more than happy to share.
Thanks,
Kurt