• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

How to refer javascript variables in ASP (Classical) ?


I have some javascript variables. I want to refer them in Active Server Pages - server side. Can you please let me know how to do that ?

<script language="javascript" type="text/javascript">
int i
int j

I want to refer these two variables in Active Server Pages (Classical) - server side.

1 Solution
John EastonDirectorCommented:
JavaScript is a client side language.  It is executed only in the client browser.

ASP is a server side language.  It is executed on the server and then sent a plain HTML to the browser.  It is possible to manipulate the JavaScript using ASP, but once it is sent to the browser ASP has no access to the data.

Depending on what you want to achieve using AJAX may work.
milani_lucieAuthor Commented:

CDONTS can accept multiple file attachments ? File attacments may be something like this:

Attachment 1)  http://google.com/Image1.jpg
Attachment 2)  http://Bing.com/Image2.jpg

Can you please provide me the code for this ?

Scott Fell, EE MVEDeveloperCommented:
If you don't need to use the variables while the page is loading then you can use your javascript variable to place the value to a vbs variable that you can access when the page is posted or reused.  

You may have a form field for instance and a js value.  Once the page loads, you can use js to fill in the value of your form field.  Then when you post the page, it will be just as if you typed in the data to your field.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now