siddhant1999
siddhant1999

Reputation: 65

How to access a variable created in JavaScript in ASP

I have a variable that I'm defining in JavaScript:

<script>
  var foo = 5;
</script>

<%  
  For i = foo To 10  
    'do something...
  Next  
%>

Currently the access to foo does not work; how can I access the value? Should I use a form? Please note that I'm using classic ASP not ASP.NET.

Upvotes: 0

Views: 34

Answers (1)

JmLavoier
JmLavoier

Reputation: 623

ASP is on server side, and Javascript is on cliente side, you can't do this. You can submit variable value by form.

Upvotes: 1

Related Questions