Thanks James. Your replacement suggestion is working good. Only thing I have to solve now is handling '\' literal. If I have '\' in my string, it is missing when I assign it from server vbscript to cleint javascript. I tried replacing \ with \\, but no use.
gangar
Posts
-
getting string from server script to Client script -
getting string from server script to Client scriptJames Simpson wrote:
Its a been a while since I have used ASP, but I dont get while you are calling Response.BinaryWrite. The response is the output of the ASP page which I gather is the above code, so I don't see why your calling Response.BinaryWrite?
Hello, I am kind of new to ASP. so I was trying to different ways to extract string. I tried the replace, but same result(error).
<%Dim Binary11 Binary11 = Request.BinaryRead(Request.TotalBytes) Dim I, S For I = 1 To LenB(Binary11) S = S & Chr(AscB(MidB(Binary11, I, 1))) Next Replace S,"\r",Chr(13) Replace S,"\n",Chr(10) %> outputstr = "<%= Server.HTMLEncode(S) %>"
-
getting string from server script to Client scriptI tried Html encoding, and having same problem. I tried with simple \n in the input string: function DisPlayMsg() { var outputstr outputstr = "<%= Server.HTMLEncode(Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))) %>" alert(outputstr) } And after server process: function DisPlayMsg() { var outputstr outputstr = "abcd efgh" alert(outputstr) } Ann obviously it is erroring out.
-
getting string from server script to Client scriptHello, I am posting string data from C++ application, which uses activex webbrowser control, to ASP. The only way i can post this string in binary using safearray. Anyhow, I am able to successfully read this string in ASP server and assign it to client script varible using following statement. inputstr = "<%Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))%>" The problem is when i have some special characters like ",\r,\n... in my string. Is there a way to get this string to client sdie, so that i parse it and populate fields. Thanks
-
Reading sent string using POST method in ASPThe activeX control from C++ is posting data in binary. I am able to read the data in ASP using Response.BinaryWrite(Request.BinaryRead(Request.To talBytes)) Is there any easy way to read or convert it into string in my ASP? I tried Request.Form("MyInput") and Request("MyInput") but no help.
modified on Tuesday, April 22, 2008 12:13 PM
-
Reading sent string using POST method in ASPHello, I am VC++ programmer. I am novice to ASP. I am using CWebBrowser2(ActiveX control) to navigate some user-written ASP pages from my application. When I navigate from my CWebBrowser2 control, I am telling it to use POST transaction instead of GET transaction and sending some Post data string. The problem is I don't know correct way how to read this data in ASP. I used Request method but no use. Offcourse, I am not sure 100% that my activeX control is really using POST method to send data correct way. Can somebody help me to read post data. Or is there a way to monitor IIS to see how the activex control sending the request ? FYI: I am sending string : "MYInput=This is my input" Thanks.
-
CWebBrowser2 related help pleasebob16972 wrote:
SafeArrays are a pain in the behind but a necessity if you want to post data.
Thanks bob for your reply. I built postdata param as follows: CComVariant postData("MyInput=My Custom Input"); char* postDataString = "MyInput=My Custom Input"; int len = strlen(postDataString); postData.vt = VT_ARRAY; postData.parray = SafeArrayCreateVector(VT_UI1, 0, len); void HUGEP* safeData; SafeArrayAccessData(postData.parray, &safeData); memcpy(safeData, postDataString, len); SafeArrayUnaccessData(postData.parray); May be i am doing something wrong on ASP side to retrieve this postdata. I am novice in ASP. Can somebody tell me ASP command to retrieve it?
-
CWebBrowser2 related help pleaseHello, Our application developed using VC++ with COM. Our new requirement is to launch user written ASP forms from our application. To achieve this I added CWebbrowser2 control in our dialog and launched ASP pages using Navigate method. The problem is that we need to pass some input data to these ASP pages before it diplayed in CwebBrowser. This input is to fill out some fields on ASP form.I tried to pass this by appending input string to URL, but there is 2083 characters limit on URL. Is there anyway I can pass huge input string to ASP? I tried to use PostData parameter in CwebBrowser.Navigate(...) method but no success. I am also open to any alternative approach for my requirement other than CWebbrowser2 control. Advance thanks to responders.