I want to inject a presenter into my webform class. While doing so I would like the injected presenter to contain a reference to the view it is being injected into. Inject a class with a reference to the class it is injected into. Is it possible to do this with Ninject? When injecting into a webforms class, is the injection performed before the constructor is executed? Should I rather just inject the presenter and use the constructor to pass the view?
Can Ninject inject a class and make it reference the target class as a back reference?
546 Views Asked by Lars Kristian Hagen At
1
There are 1 best solutions below
Related Questions in DEPENDENCY-INJECTION
- Resolve object using DI container with object instance
- Angularjs dependency injection parameter
- Dagger 2 - unable to inject object
- How to have SimpleInjector resolve viewmodel dependencies?
- Command Bus/Dispatcher and Handler registration without Dependency Injection
- Receiving a NoClassDefFoundError even though jar is successfully downloaded via Maven and referenced in pom.xml
- automapper error collection was modified when multiple users are creating a user
- When to use DI over abstract inheritance?
- Simple Injector Dependency Resolution Error - Could not load file or assembly System.Web.Http
- How can I use Dependency Injection to either Override a method or to set a default method when no dependency is explicitly injected?
- Injecting login session using Dagger
- What's wrong with this factory dependencies issue?
- JAVA CDI: sometimes injection stays null when injected into EJB and interceptor in request scope
- Why a service of main module available in other modules?
- Can I specify multiple parameters using WhenInjectedInto for ninject?
Related Questions in WEBFORMS
- Writing/Overwriting to specific XML file from ASP.NET code behind
- Cannot find InvalidCastException in C# Application
- Read Hyperion Planning webform XML with VBScript
- ASP.NET Web Forms give error while connecting to Oracle 11g
- Most effective way to bind data models in WebForms without stored procedures?
- change loginpath for specific user, ASP.Net, webforms
- How to pass data from MVC Controller to ASPX Page?
- ASp.Net Identity Role manager
- ASP.NET Webforms project is reading from a web.config in a completely different solution on my PC when debugging
- popup login asp.net webform project with database code
- InnerHtml of div is always empty
- RadioButtonList value is null
- How to style asp.net menu control with responsive bootstrap css
- Getting the session ID causes the user to logout
- how to stop viewstate going stale?
Related Questions in NINJECT
- Can I specify multiple parameters using WhenInjectedInto for ninject?
- Entity framework object not updating after being passed around
- How do I use GetAll with Ninject so that one failure doesn't stop the other bindings from resolving?
- How to use the Ninject xml config with TEntity?
- Ninject 1.0 to 2.0 .Only
- Set Ninject property to private
- How can I force Ninject to exception when largest constructor has unresolvable dependencies?
- Property setter injection [Inject] Not working
- How to test use of DI (NInject)
- Dependency Injection for concrete .Net classes
- How to have NInject follow type hierarchy?
- Ninject generic type xml binding
- Use NInject to initialize several collections
- Ninject's AllowNullInjection not working in ASP.NET WCF
- Hangfire configuration and Ninject configuration
Related Questions in PRESENTER
- Using presenters (Ryan Bates' style) without an associated model
- Where to call for web API in Android MVP
- Presenter in MVP(Android) gets deleted/gets null inside Fragment
- In MVP pattern, should Presenter be activity-wise or functionality-wise of Android app
- GWT & MVP - Best practices for displaying/editing complex objects?
- How to create AsyncCallback call for Presenter Widget in GWTP?
- DDD / Presenter pattern VS Use case optimal query
- How to wait for RPCs from another presenter?
- Using rails presenters - memoizable getting deprecated in 3.1 - use ||= instead?
- uninitialized constant for HomePresenter
- Using a presenter with Inherited Resources
- Ruby on Rails patterns - decorator vs presenter
- Derived Interface with derived interface member
- Android: Application crashes because of presenter error?
- Rails Presenter - Interacting with 2 different models that share the same attribute
Related Questions in NINJECT.WEB
- WebApi Ninject with InRequestScope with OPTIONS call
- Simplify NinjectWebCommon RegisterServices with a Generic Service
- Cannot view controls in design mode using Ninject.Web
- Ninject inject dependency based on the controller
- Ninject specify binding scope of non referenced component
- Ninject bug resolving constructor with multiple string parameters
- Ninject-ing Mehdime.Entity.IDbContextScopeFactory failing
- ASP.NET MVC 3 and Global Filter Injection
- ASP.NET MVC 2, Ninject 2.2 and no parameterless constructor defined for this object
- This 404 seems unavoidable - what am I doing wrong? [Ninject 2.0 with ASP.NET MVC 2 on .NET 4]
- Ninject woes... 404 error problems
- "Per request" activation context ... without request
- How to setup ninject when injection and Module binding (nInjectModule) into separate assembly
- Ninject injection not working on subclasses
- Ninject per session singleton?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
For webforms this is not possible because the form is not created by ninject. You have to pass it manually to the presenter.
I think the solution is to use MVC there you have support for your problem form the framework. Webforms and MVC can be mixed. You can create new pages with MVC and still use the old webform ones. Whenyou have to change a webforms page then you better refactor it to MVC befor the change.