tags:

views:

11

answers:

2
<script ID="clientEventHandlersVBS" LANGUAGE="vbscript">

s=pass()
y=s

</script>
<%
session("password")=y
Response.write(session("password"))
Response.write(y)
%>

i have this code. but nothing is getting stored inside the session variable neither anything is getting printed. cant i access the variables declared outside the asp code or is their any syntax mistake. any help is really appreciated

A: 

First of all put

<% Option Explicit %>

at the top of every .asp page.

You will immediatly see that you are trying to access non declared variabels s and y.

So of course nothing is stored in the session variables.

Can you not use

<%
   s = pass
   y = s
%>

and so on ?

What is the purpose of the <script ... line if you are using vbscript any how ?

Edelcom
A: 

As implied by the ID of the script (clientEventHandlersVBS) the code contained in there refers to the client (the browser, IE in this case since it is the only one that supports VB client-side)

the <% %> tags though refer to server side ASP code..

These two can never communicate as they happen at different times/computers...

Gaby