Nodir
Nodir

Reputation: 369

Call server side vb code from js (asp classic)

I have code written in server side VB.

<script language="vbscript" runat="server">
Function SomeMethod()
   ....
End Function 
</script> 

How I can call this piece of code from javascript part of server side code?

 <script language="javascript" runat="server">
    //some code

    var a = SomeMethod();

 </script>

When I try to call VB function the next error occurs.

Microsoft JScript runtime error '800a138f' Object expected

Thank you!

Upvotes: 0

Views: 2590

Answers (1)

AnonJr
AnonJr

Reputation: 2757

This is essentially the same question as this one, though the focus is more on the order of execution side of things. ASP will execute the scripts in different order, depending on the language and syntax:

  1. global.asa
  2. server-side includes
  3. Javascript tagged with <script> tags
  4. HTML together with scripts tagged within <% %> delimiters
  5. VBscript tagged within <script> tags

More information can be found at MSDN and OWASP.

Upvotes: 1

Related Questions