Solved

set server side vbscript variable from client side javascript?

Posted on 2002-03-04
2
1,391 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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