Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6672801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:33:03+00:00 2026-05-26T03:33:03+00:00

In MVC 3, I understand you can create custom WebViewPages. Can you inject dependencies,

  • 0

In MVC 3, I understand you can create custom WebViewPages. Can you inject dependencies, using constructor injection, via an IOC container?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:33:04+00:00Added an answer on May 26, 2026 at 3:33 am

    There is an expample for view injection in a blog post by Brad Wilson http://bradwilson.typepad.com/blog/2010/07/service-location-pt3-views.html

    The statements of the others that views allow constructor injection not entirely correct. Yes IDependencyResolver enables creating views that have constructor arguments. But unless you are implementing your own view engine this won’t help you at all. Existing view engines like razor will require that you have a parameterless constructor. This means you can do only property injection on views with them.

    But as the others said you shouldn’t do view injection anyway. Your view should be dumb and just render the view model to HTML. Anything requiring a dependency should be done in the controller or a service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that you can now create MVC-specific user controls, but will my existing
Currently I'm trying to understand dependency injection better and I'm using asp.net MVC to
I'm using the MVC beta to write a simple application to understand ASP.Net MVC.
I am using asp.net mvc 2 and create localization based on routes. my route
I am building a custom MVC framework using PHP. My problem is when I
I am trying to create a very basic MVC framework to better understand the
From what I understand about Windsor Container and MVC applications, is that there should
I understand that the AntiForgeryToken feature in ASP.NET MVC does prevent cross-site attacks. However,
As I understand it, in ASP.NET MVC a httprequest is mapped to a controller/action.
I am working on a website in which many users can create their account

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.