I am using ASP.NET Webforms and in one page I want to make an AJAX call to a web method in the code behind. The problem is that web methods are static and I can\'t access page v
You can directly retrieve it from the kernel using the IKernel.Get() method:
IKernel.Get()
[WebMethod] public static string DoSomething() { NinjectModule module = new YourModule(); IKernel kernel = new StandardKernel(module); var controller = kernel.Get(); controller.WriteToLog(); }