Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I pass values from <%asp%> vars to client?

Status
Not open for further replies.

kingpoop

Programmer
Sep 11, 2001
7
US
Is it possible to pass data between server-side
asp variables and client-side vbscript of javascript
variables?

For example:
<%
...
Set adoRst = Command.Execute
myVar = adoRst.Fields(&quot;FieldName&quot;).Value
...
%>
<SCRIPT Language=&quot;vbscript&quot;>
How can I reference the myVar variable
from within the script tags
</SCRIPT>
 
You can just write the variable in the script area like this:

<%
...
Set adoRst = Command.Execute
myVar = adoRst.Fields(&quot;FieldName&quot;).Value
...
%>
<SCRIPT Language=&quot;vbscript&quot;>
function useVar()
msgbox &quot;<%=myVar%>&quot;
end function
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top