Search code examples
javascriptasp-classicvbscriptclient-sideserver-side

Passing the asp classic html as a string from client-side to server-side


I am having the next scenario (I can't change it). I have an classic asp page. In it, I have the asp code, the javascript code, and the VBscript code. When the user clicks the button confirm, the javascript function "confirm" is executed. In it, the page submits a form to itself.

What I want to accomplish is the next thing. Inside that javascript function confirm, I can easily get the web page html as a string. But what I want is to get that string in the VBScript part when the page processes the self-submit done. I have tried the next things:

  1. Inserting in an asp input hidden control in the page, and load from JavaScript the needed string in that input. Afterwards I expected to get it in VBScript by Request("controlId/controlName"). But it fails me because the input hidden control can't have strings that large.

  2. In the JavaScript confirm function, to load in a session variable in the string. But it looks like I can't write a client-side variable in a session variable.

  3. To store through the JavaScript function a temporary file and passing it through a input file control. This I only have thought about it. Because i don't think that it is a good solution to store a temporary file in the client-side, and I still have the believe to find a better solution than this. Also I don't know exactly how to write files with JavaScript in the client-side.

I remember that I have tried all this, if I remember another thing that I tried, I will post it here.

I have slammed my face repeatedly against the desktop, but I can't find a solution to this. Any idea would be really helpful.


Solution

  • So you want to get html page in your ASP using javascript?

    Why do you want to do that. You can use your a form with a post method to send big string.