2

I'm maintaining a solution developed in .NET Framework 4.7.2 and using ASP.NET Webforms. To do some serverside functions I'm using WebMethods. The framework is exposing a PageMethods (object i assume?) to call the functions through.

Example

PageMethods.Foo(val1, val2, onOk, onFailed)

The problem here is that i can't find any solutions to get Intellisense for these (In this case Foo). To me this is the same problem as magic strings, that i have to copy and paste, to make sure it works. And it would be nice to know the signature when writing.

Is there any solution to this?

TheKlinto
  • 31
  • 2

1 Answers1

0

I was able to get this to work using a TypeScript declaration file. I had to declare PageMethods and my [WebMethod].

declare class PageMethods {
    Foo(): void;
}

declare function Foo(val1: string, val2: string, onOk: function, onFailed: function): void;
ibach80
  • 43
  • 1
  • 7