Solved

ASP / Variables

Posted on 1998-09-24
2
247 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to count occurrences of each item in an array.

696 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