all groups > inetserver asp components > november 2006 >
You're in the

inetserver asp components

group:

How do I call a function in .vbs file using <script../> tags from asp page?


How do I call a function in .vbs file using <script../> tags from asp page? thisis
11/5/2006 10:56:30 PM
inetserver asp components:
Hi All,

i have this.asp file:

<script src="test.vbs" runat="server" language="vbscript"></script>

<html>
<body>
1 + 2 = <%=DoSomething(1,2)%>
<div id="divLocal" />
</body>
</html>

and test.vbs file:

Function DoSomething(a, b)
DoSomething = a + b
End Function


both files are located in the same folder.

i tried to run the this.asp file and i get this error message on the
internet explorer:

1 + 2 =
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'DoSomething'

/dt/this.asp, line 5


My Question:

How do I call a function in .vbs file using <script../> tags from asp
page?
Re: How do I call a function in .vbs file using <script../> tags from asp page? Daniel Crichton
11/6/2006 12:44:15 PM
thisis wrote on 5 Nov 2006 22:56:30 -0800:

[quoted text, click to view]

Just tried this on IIS6 here and it works fine. What version of IIS are you
using? This will not work on IIS4 or earlier.

Dan

Re: How do I call a function in .vbs file using <script../> tags from asp page? Daniel Crichton
11/6/2006 12:46:38 PM
In addition to my other reply, apparently IIS5 process the <script> tag
after the rest of the page, so when it executes DoSomething in the ASP page
there is not yet a DoSomething function. IIS6 appears to change the
processing order, so unless you're using IIS6 on Windows 2003 (I can't test
IIS7 on Vista to see if this works the same, but it should) your code is not
going to work.

Dan

Re: How do I call a function in .vbs file using <script../> tags from asp page? Anthony Jones
11/6/2006 1:35:10 PM

[quoted text, click to view]

PWS in Win 98. ;)

[quoted text, click to view]

Re: How do I call a function in .vbs file using <script../> tags from asp page? Anthony Jones
11/6/2006 1:38:23 PM

[quoted text, click to view]

It works on my IIS 5.0 Win2000 server and my IIS 5.1 XP Pro. Not too
surprising since I wrote it in the first place. Glad to see it works on
IIS 6 also.

What default ASP script language do you have set for the application on the
IIS5 server where it fails?


[quoted text, click to view]

AddThis Social Bookmark Button