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

Ask a Question related to ASP Components, Design and Development.

  1. #1

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

    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?

    thisis Guest

  2. Similar Questions and Discussions

    1. Can serverside script call php file?
      So, can asc file can call php file via LoadVars or amfPhp (remoting)? Im new to FMS2 and google doesnt seem to help me much to find good information....
    2. How to call a coldfusion function defined in other coldfusion file??
      inside a.cfm, it has code fragment: <cfloop> <cfinclude template="b.cfm"> </cfloop> inside b.cfm, it has code fragment: ...
    3. Call page from function
      Hi, I'm trying to use the web timer to schedule a call to an asp page. In practice, I want the server calls an asp page that makes several jobs. The...
    4. How do I call an outer function from a class method function?
      I'm sorry guys but this is a bad day for me. I tried researching this one and was totally stonewalled (see...
    5. SSI or Script Tags
      Is there any advantage of one method over the other between the following for including some server-side library code? <!-- #INCLUDE...
  3. #2

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

    thisis wrote on 5 Nov 2006 22:56:30 -0800:
    > 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?
    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


    Daniel Crichton Guest

  4. #3

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

    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


    Daniel Crichton Guest

  5. #4

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


    "Daniel Crichton" <msnews@worldofspack.com> wrote in message
    news:ew71FFaAHHA.3396@TK2MSFTNGP02.phx.gbl...
    > thisis wrote on 5 Nov 2006 22:56:30 -0800:
    >
    > > 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?
    >
    > 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.
    >
    PWS in Win 98. ;)
    > Dan
    >
    >

    Anthony Jones Guest

  6. #5

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


    "Daniel Crichton" <msnews@worldofspack.com> wrote in message
    news:%23lgebGaAHHA.1224@TK2MSFTNGP04.phx.gbl...
    > 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.
    >
    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?

    > Dan
    >
    >

    Anthony Jones Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139