ASP and VBScript


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: ASP and VBScript

  1. #1
    JamesN Guest

    ASP and VBScript


    hi,

    i'm new to asp and was wondering if there is any way to call asp routines
    inside a vbscript function
    example:

    <SCRIPT=VBSCRIPT RUNAT=SERVER>
    function xxx()
    <% asp code here %>
    end function

    </SCRIPT>

    Am I trying to do the impossible?

    Thx,
    James



  2. #2
    mister pants Guest

    Re: ASP and VBScript


    No, you can't call ASP function from client-side script, becuase by the time
    the client-side script runs the server is already finished and it's not an
    interactive process. Any serve code you want to run has to originate from
    the browser submitting a page / going to a new URL etc.

    You can however 'pass' ASP variables to client side code in a manner of speaking
    :

    <% 'server code
    dim x
    x = 1
    %>

    <script language=pants>
    'client code
    dim y

    'assign y (client var) the value of x (server var)
    y = <% =x %>

    </script>

    You can also 'generate' client script in much the same way as you would construct
    an sql statement etc.

    HTH


    "JamesN" <webdev.@127.0.0.1> wrote:
    >
    >hi,
    >
    > i'm new to asp and was wondering if there is any way to call asp routines
    >inside a vbscript function
    >example:
    >
    ><SCRIPT=VBSCRIPT RUNAT=SERVER>
    >function xxx()
    ><% asp code here %>
    >end function
    >
    ></SCRIPT>
    >
    >Am I trying to do the impossible?
    >
    >Thx,
    >James
    >
    >



  3. #3
    JamesN Guest

    Re: ASP and VBScript


    Hi

    Thanks for that....another question: is there a way to ASP client side variables
    inside a vbscript routine to a session variable declared in the global.asa
    file?

    James

    "mister pants" <mister_pants_2@hotmail.com> wrote:
    >
    >No, you can't call ASP function from client-side script, becuase by the

    time
    >the client-side script runs the server is already finished and it's not

    an
    >interactive process. Any serve code you want to run has to originate from
    >the browser submitting a page / going to a new URL etc.
    >
    >You can however 'pass' ASP variables to client side code in a manner of

    speaking
    >:
    >
    ><% 'server code
    >dim x
    >x = 1
    >%>
    >
    ><script language=pants>
    >'client code
    >dim y
    >
    >'assign y (client var) the value of x (server var)
    >y = <% =x %>
    >
    ></script>
    >
    >You can also 'generate' client script in much the same way as you would

    construct
    >an sql statement etc.
    >
    >HTH
    >
    >
    >"JamesN" <webdev.@127.0.0.1> wrote:
    >>
    >>hi,
    >>
    >> i'm new to asp and was wondering if there is any way to call asp routines
    >>inside a vbscript function
    >>example:
    >>
    >><SCRIPT=VBSCRIPT RUNAT=SERVER>
    >>function xxx()
    >><% asp code here %>
    >>end function
    >>
    >></SCRIPT>
    >>
    >>Am I trying to do the impossible?
    >>
    >>Thx,
    >>James
    >>
    >>

    >



  4. #4
    Russell Jones Guest

    Re: ASP and VBScript

    Assign them to a hidden field in your client-side script that exists inside
    a <form> tag, and then post that form data from the client, or pass them to
    the server via a cookie or URL parameter. Use the Request object on the
    server to retrieve the values and store them in the Session variable.


    "JamesN" <webdev.@127.0.0.1> wrote in message
    news:3e5f230c$1@tnews.web.devx.com...
    >
    > Hi
    >
    > Thanks for that....another question: is there a way to ASP client side

    variables
    > inside a vbscript routine to a session variable declared in the global.asa
    > file?
    >
    > James
    >
    > "mister pants" <mister_pants_2@hotmail.com> wrote:
    > >
    > >No, you can't call ASP function from client-side script, becuase by the

    > time
    > >the client-side script runs the server is already finished and it's not

    > an
    > >interactive process. Any serve code you want to run has to originate from
    > >the browser submitting a page / going to a new URL etc.
    > >
    > >You can however 'pass' ASP variables to client side code in a manner of

    > speaking
    > >:
    > >
    > ><% 'server code
    > >dim x
    > >x = 1
    > >%>
    > >
    > ><script language=pants>
    > >'client code
    > >dim y
    > >
    > >'assign y (client var) the value of x (server var)
    > >y = <% =x %>
    > >
    > ></script>
    > >
    > >You can also 'generate' client script in much the same way as you would

    > construct
    > >an sql statement etc.
    > >
    > >HTH
    > >
    > >
    > >"JamesN" <webdev.@127.0.0.1> wrote:
    > >>
    > >>hi,
    > >>
    > >> i'm new to asp and was wondering if there is any way to call asp

    routines
    > >>inside a vbscript function
    > >>example:
    > >>
    > >><SCRIPT=VBSCRIPT RUNAT=SERVER>
    > >>function xxx()
    > >><% asp code here %>
    > >>end function
    > >>
    > >></SCRIPT>
    > >>
    > >>Am I trying to do the impossible?
    > >>
    > >>Thx,
    > >>James
    > >>
    > >>

    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center