How can Server-Side variable'value be given to Client-Side variable by program

Discussion in 'ASP General' started by Jack, Jan 29, 2004.

  1. Jack

    Jack Guest

    Hello,
    <%@ Language=VBScript %>
    <%
    dim a
    a=10
    'I want b=a at this place
    %>
    <Script language=VBScript>
    dim b
    </Script>
    How can a'value be given to b by program?
    Thank you
     
    Jack, Jan 29, 2004
    #1
    1. Advertising

  2. Jack

    Bob Barrows Guest

    Jack wrote:
    > Hello,
    > <%@ Language=VBScript %>
    > <%
    > dim a
    > a=10
    > 'I want b=a at this place
    > %>
    > <Script language=VBScript>
    > dim b

    b=<%=a%>

    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Jan 29, 2004
    #2
    1. Advertising

  3. Jack

    Ray at Guest

    Picture it this way. If you wanted to give b the value of 10 in your
    client-side code, you'd do:

    <script language=vbscript>
    Dim b
    b=10
    </script>

    So, what you want is the number 10 in your response. Well, on the server,
    the "a" variable has a value of 10, so you'd want to response.write the
    evaluated value of the server-side variable, a.

    <%
    ''server side code
    Dim a
    a = 10
    %>

    <script language=vbscript>
    ''client side code
    Dim b
    b=<%=a%>
    </script>


    Ray at home

    "Jack" <> wrote in message
    news:%...
    > Hello,
    > <%@ Language=VBScript %>
    > <%
    > dim a
    > a=10
    > 'I want b=a at this place
    > %>
    > <Script language=VBScript>
    > dim b
    > </Script>
    > How can a'value be given to b by program?
    > Thank you
    >
     
    Ray at, Jan 29, 2004
    #3
  4. Jack

    Jack Guest

    Thank you very much
     
    Jack, Jan 29, 2004
    #4
    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. Lord0
    Replies:
    1
    Views:
    581
    Thomas Weidenfeller
    Apr 19, 2006
  2. Replies:
    4
    Views:
    7,309
    Eliyahu Goldin
    Jul 13, 2006
  3. chiara
    Replies:
    6
    Views:
    490
    Barry Schwarz
    Oct 6, 2005
  4. 2Barter.net
    Replies:
    0
    Views:
    380
    2Barter.net
    Dec 13, 2006
  5. Jack
    Replies:
    4
    Views:
    196
    Phillip Windell
    Nov 26, 2003
Loading...

Share This Page