Solved

ASP / Variables

Posted on 1998-09-24
2
218 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
ID: 1855263
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
ID: 1855264
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

24 Experts available now in Live!

Get 1:1 Help Now