?
Solved

ASP / Variables

Posted on 1998-09-24
2
Medium Priority
?
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 140 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

800 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