-
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
-
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
>
>
-
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
>>
>>
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks