Professional Web Applications Themes

How do I call a function in .vbs file using <script../> tags from asp page? - 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?...

  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. #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

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

  4. #4

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


    "Daniel Crichton" <msnewsworldofspack.com> wrote in message
    news:ew71FFaAHHA.3396TK2MSFTNGP02.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

  5. #5

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


    "Daniel Crichton" <msnewsworldofspack.com> wrote in message
    news:%23lgebGaAHHA.1224TK2MSFTNGP04.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

Similar Threads

  1. Can serverside script call php file?
    By butcho in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: August 3rd, 12:42 PM
  2. How to call a coldfusion function defined in other coldfusion file??
    By apngss@yahoo.com in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: October 24th, 07:30 PM
  3. Call page from function
    By logologo in forum ASP.NET Web Services
    Replies: 1
    Last Post: April 30th, 01:14 PM
  4. How do I call an outer function from a class method function?
    By Phil Powell in forum PHP Development
    Replies: 5
    Last Post: October 16th, 09:56 AM
  5. SSI or Script Tags
    By Brian Staff in forum ASP
    Replies: 0
    Last Post: July 2nd, 06:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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