Solved

ASP / Variables

Posted on 1998-09-24
2
203 Views
Last Modified: 2013-12-25
I am using IE4 and ASP(the VBScript version).

I have an ASP page that needs to keep track of a variable from one frame to the other.  So, I have stored this 'variable' in a hidden text box.  However, I do not know how to read the contents of a text box from an ASP rountine.  So I have tried storing the data in the hidden text box, reading it out with VBScript, then reading the VBScript variable with my ASP code.  It won't let me share the variables like that.

Does anyone know how to either A.) Read the contents of a text box from ASP or B.) Share a variable between VBScript and ASP?
0
Comment
Question by:Egore
2 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 70 total points
Comment Utility
You must be very careful with the difference between server-side script and client-side script. Those may use the same language (VBScript, or Javascript), and are written in the same asp-file, but they will run on different machines:

server-sdie script (between the <% and %>) runs on the server. Client side script runs on the machine of the visitor.

To share variables between them you have to have some interaction:

client -> server: submission of a form
server -> client: sending HTML/script code on request

=============
To read the variables from a submitted form in ASP, do this:
This "transfers" client side variables to the server.
<%
MyVar1 = Request("name_of_the_formvariable")
%>
================
To bring server-side variables to client side script use something like this:



<%
MyVar2 = "This is a server-side string"
%>

<script language="vbscript">
'this is client side script
MyClientVar = <%=MyVar2%>
</script>

============

As you can see there is no way to define a variable that is really shared by client and server, there always has to be some transfer of information.

0
 
LVL 3

Author Comment

by:Egore
Comment Utility
The problem with your answer is that I need the exact opposite to take place.  Either client to server variable transfer or I need the server-side script to acces text boxes that ARE NOT submitted to the page.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now