I have a really beginner’s level question.
I am trying to get going with Ninject in an ASP.NET WebForms application, but I don’t know how. I know how to do this, roughly, in MVC 3, as described here. But, I’m stuck when trying to do the same thing in a WebForms app.
For example, in a WebForms app, where do I setup binding similar to below?
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<IRepository>().To<MyRepositoryImpl>();
kernel.Bind<IWebData>().To<MyWebDAtaImpl>();
}
This is an example of the kinds of questions I have, and am hoping the SO community can help with. I have lots of such questions, but in an attempt to just start somewhere, I’ll leave off with that one question for now.
Do you mean WebForms?
You will want to do container registration in the global.asax, in the Application_OnStart event.