Solved

set server side vbscript variable from client side javascript?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

21 Experts available now in Live!

Get 1:1 Help Now