Ridha Ammar

Ridha Ammar

  • 2k
  • 10
  • 86

How calling vb function from js in visual webgui app?

Oct 26 2020 3:24 AM
In my Gizmox Webgui application (vb code) I have: "Form1" containing an "HtmlBox1" control In the form I have the following function:
  1. <PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _  
  2. <System.Runtime.InteropServices.ComVisibleAttribute(True)> _  
  3. Public Sub VbHelloWorld()  
  4. MsgBox("Hello Ridha Ammar")  
  5. End Sub  
In order to call this function from "HtmlBox1.html" I added to the html code of the "HtmlBox1" control the following script:
  1. function showVbFunction (){  
  2. window.external.VbHelloWorld ();  
  3. }  
and the following link:
  1. <a href="#"> Say Hello World From VB </a>  
When debugging and clicking the link, I get the following error:
 
"window.external.VbHelloWorld is not a function"
 
The script cannot access the function.
 
Is there anyone who can help me? 

Answers (1)