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!

I have an ASP page that contains as

Status
Not open for further replies.

ktwclark

Programmer
Jan 30, 2002
54
GB
I have an ASP page that contains asp code and also vbscript code. The problem I have is I need to use Global variables that can be used within both the ASP code and the vbscript code.

Is this possible? Or do you have a suggestion as to how I can take a variable from ASP code and use it in vbscript code?
 
I dont know much VBscript but this can be adapted in the same way.

-----------------
<%
a_variable = global(&quot;whatever&quot;)
%>
<html>
<head>
<script language=javascript>

alert(&quot;<%=a_variable%>&quot;)

</script>
</head>
</html>
 
Doh, try this instead.

<%
a_variable = application(&quot;whatever&quot;)
%>
<html>
<head>
<script language=javascript>

alert(&quot;<%=a_variable%>&quot;)

</script>
</head>
</html>
 
Yep, discovered after a few attempts:

<%
Dim a
a = 1
%>

<SCRIPT language=VBScript>
<!--
b = <%=contents%>
-->
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top