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
[339 byte] By [
JamesN] at [2007-11-9 17:48:52]

# 1 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
>
>
# 2 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
>>
>>
>
JamesN at 2007-11-11 23:18:18 >

# 3 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.dev-archive.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
> >>
> >>
> >
>
