Accessing Javascript variable data from ASP

Discussion in 'ASP General' started by Rags, Apr 6, 2004.

  1. Rags

    Rags Guest

    Hi

    This is Rags, I want know how can we access the a
    Javascript variable value from the ASP code..(At the
    server side)

    <%
    Dim mItemcode
    %>
    <SCRIPT>
    var item
    item='My Item';
    </SCRIPT>

    In the above example, I want how can i access item variable
    (javascript) value into the asp variable mItemcode

    regards
    rags
    Rags, Apr 6, 2004
    #1
    1. Advertising

  2. Rags, you can't get there from here. Javascript is a client-wide
    technology, ASP is server side. The only way to pass your values to an asp
    variable is through a querystring:

    document.location="mypage.asp?item1=shirt&item2=socks&item3=shoes"

    or through a form:

    <form action="mypage.asp" method="get">
    <input type=hidden name=item1 value="shirt">
    <input type=hidden name=item2 value="socks">
    <input type=hidden name=item3 value="shoes">
    </form>

    Once either happens, you can then process the values any way you like.

    "Rags" <> wrote in message
    news:190d401c41bf5$97d56a60$...
    > Hi
    >
    > This is Rags, I want know how can we access the a
    > Javascript variable value from the ASP code..(At the
    > server side)
    >
    > <%
    > Dim mItemcode
    > %>
    > <SCRIPT>
    > var item
    > item='My Item';
    > </SCRIPT>
    >
    > In the above example, I want how can i access item variable
    > (javascript) value into the asp variable mItemcode
    >
    > regards
    > rags
    William Morris, Apr 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shil
    Replies:
    2
    Views:
    2,024
    Eliyahu Goldin
    Jan 2, 2007
  2. Mohanasundaram
    Replies:
    44
    Views:
    1,065
    Keith Thompson
    Aug 24, 2004
  3. Jonas Daunoravicius
    Replies:
    5
    Views:
    306
    Peter
    Jul 17, 2003
  4. Steve Cosh
    Replies:
    1
    Views:
    163
    joewiii
    Nov 18, 2005
  5. Jonas Daunoravicius
    Replies:
    5
    Views:
    282
    Peter
    Jul 17, 2003
Loading...

Share This Page