Solved

set server side vbscript variable from client side javascript?

Posted on 2002-03-04
2
1,388 Views
Last Modified: 2008-02-26
I have a variable I have set using client side javascript ..

when I open another window, is there any way I can set a server side vbscript variable from that javascript variable?

i'm using iframes when i load the asp pages, so i could access that variable in javascript like this:

window.parent.parent.myVariable

but can I somehow take that variable and assign it to a vbscript variable?

Thanks,

0
Comment
Question by:SeanGraflund
2 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 50 total points
ID: 6838990
There is basically two ways of sending values from the client side to the server side, either in the query string, or in a form.

Query string:

---javascript on first page---
var value=42;
window.open('Page2.asp?Param='+value,'_blank');

---Page2.asp---
<%
Value=Request.Querystring("Param")
%>

Form:

---first page---
<form name="TestForm" action="Page2.asp">
<input type="hidden" name="HiddenField" value="">
</form>
<script>
value=42;
document.TestForm.HiddenField.value=value;
document.TestForm.submit();
</script>

---Page2.asp--
<%
Value=Request.Form("HiddenField")
%>
0
 
LVL 1

Author Comment

by:SeanGraflund
ID: 6847142
well, i understand how those two work, but it didn't provide the results i wanted ..

there is a 3rd option for passing variables from javascript to vbscript ... cookies.  i used that.

thanks,

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 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

10 Experts available now in Live!

Get 1:1 Help Now