In a simple statement if I want to define an ASP.NET MVC controller then I can say that it has classes which are responsible for receiving and processing incoming requests, handling client input, and sending response back to the client. Controllers also act as a coordinator between Model (Business) and View (Presentation). ASP.NET MVC framework itself create controller object at run time. Only prerequisite is controller class must have a parameter less constructor. But if you need to pass some objects with constructor then what will happen? Simply framework failed to create controller object. In that scenario we need to create controller object by our self and injection dependency there.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>ASP.NET, MVC, Dependency Injection, Computer Tutorials, .Net, Beginners Tutorials