Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ninject causes FindControl to return null in Page_Load in ASP.NET weform #99

Closed
bizzehdee opened this issue Aug 14, 2013 · 3 comments
Closed

Comments

@bizzehdee
Copy link

We have a large ASP.NET web forms project which we recently added ninject too, after adding ninject to the project references and started to use it within the project, we noticed a lot of unrelated pages began to throw null reference exceptions on Page_Load and narrowed it down to FindControl being called, although the controls where in the markup with the correct ID and runat="server" set.

We have then removed ninject, and the problem goes away.

Does ninject alter the way in which events are fired or the way in which Page_Load is ran? Or does ninject overload FindControl?

@jbdutton
Copy link

I have also noticed this issue, specifically with the Ninject.Web extension. I can successfully inject services into a Web Forms page but other, previously working and unchanged pages begin receiving null references from FindControl. Removing Ninject.Web fixes the problem.

@bizzehdee I don't have a solution for you but if I come across one I'll share.

@jbdutton
Copy link

@bizzehdee, yours may turn out to be a different issue, but I've also opened a ticket with Ninject.Web:
ninject/Ninject.Web#12

@remogloor
Copy link
Member

Replaced by ninject/Ninject.Web#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants