Program.vb WebMethod not working (2.1.41)

Answered
0
0

MustInherit Class Program …
<WebMethod>
Public Function HitFormBackButtonIfPossible() As Boolean
Dim intMax As Integer = Application.OpenForms.Count
Dim intCurrentForm As Form = Application.OpenForms(intMax – 1)
intCurrentForm.DialogResult = DialogResult.Cancel
intCurrentForm.Close()
Return True
End Function

 

 

in the Chrome console, typing App.HitFormBackButtonIfPossible() shows up in autocomplete, but trying to invoke it does this:

 

VM1543:1 Uncaught TypeError: App.HitFormBackButtonIfPossible is not a function
at <anonymous>:1:5

  • You must to post comments
Best Answer
0
0

Oops.  I had to make it a Public Shared Function  (static).

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.