Reputation: 43
How do I get a session variable into this JavaScript on a Classic ASP page?
report = Response.Write("<script type=""text/javascript"">window.open(""http://somesite.com/payvoucher.aspx?usercode=session(USERCODE)"",""_self"");</script>")
Upvotes: 1
Views: 532
Reputation: 16681
You need to concatenate the session variable Session("USERCODE")
into the string using the string concatenation character &
, unlike other languages VBScript doesn't infer a variable just by placing it inside the string.
Dim report: report = "<script type=""text/javascript"">window.open(""http://somesite.com/payvoucher.aspx?usercode=" & Session("USERCODE") & """,""_self"");</script>"
Call Response.Write(report)
Upvotes: 4