How to refer javascript variables in ASP (Classical) ?

Posted on 2012-09-17
Last Modified: 2012-09-17

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.

Question by:milani_lucie
    LVL 10

    Accepted Solution

    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.

    Author Comment


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

    Attachment 1)
    Attachment 2)

    Can you please provide me the code for this ?

    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    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

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now