Accessing Javascript variable data from ASP

R

Rags

Hi

This is Rags, I want know how can we access the a
Javascript variable value from the ASP code..(At the
server side)

<%
Dim mItemcode
%>
<SCRIPT>
var item
item='My Item';
</SCRIPT>

In the above example, I want how can i access item variable
(javascript) value into the asp variable mItemcode

regards
rags
 
W

William Morris

Rags, you can't get there from here. Javascript is a client-wide
technology, ASP is server side. The only way to pass your values to an asp
variable is through a querystring:

document.location="mypage.asp?item1=shirt&item2=socks&item3=shoes"

or through a form:

<form action="mypage.asp" method="get">
<input type=hidden name=item1 value="shirt">
<input type=hidden name=item2 value="socks">
<input type=hidden name=item3 value="shoes">
</form>

Once either happens, you can then process the values any way you like.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top