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 572041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:34:17+00:00 2026-05-13T13:34:17+00:00

My views extend a base view class I’ve made: public class BaseView : ViewPage

  • 0

My views extend a base view class I’ve made:

public class BaseView : ViewPage

At the moment I’m calling ObjectFactory.GetInstance inside this class’s constructor to get some interface implementations but I’d like to use structuremap to inject them as constructor arguments.

I’m using a structuremapcontrollerfactory to create my controllers, but how can I do the same for views?

I know I can implement a custom ViewEngine, but using reflector to look at the mvc default viewengine and its dependencies, it seems to go on and on and I’d rather not have to re-implement stuff that’s already there. How can I solve this?

I know I could make things easier with setter instead of constructor injection but I’d rather avoid that if possible.

  • 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-13T13:34:18+00:00Added an answer on May 13, 2026 at 1:34 pm

    Yes, if you are talking about the WebForms ViewEngine, you are correct in your assessment that it was not designed with inversion of control in mind. You can either lobby Microsoft to change it, or you can use setter injection. In FubuMVC, we use setter injection along with StructureMap’s BuildUp method:

    • WebFormsControlBuilder creates
      the instance of the view
    • StructureMapWebFormsControlBuilder
      derives from WebFormsControlBuilder –
      calls the base to create the
      instance, and then calls BuildUp to
      perform setter injection on all
      applicable properites.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First I create some backbone views: (function() { var SomeView = Backbone.View.extend({ ... });
I have the view class FoursquareSearch.Views.Origin extends Backbone.View events: 'change [name=origin]': 'setOrigin' 'click [name=geolocate]'
I am dynamically creating views as show below public class DynamicLayoutActivity extends Activity {
I have a base class for all views and then in each section of
So I have a View that looks like this. //base class var SelectListView =
I have created a custom Base Adapter class, to populate a list view with
Ext.define('DigitalPaper.controller.Documents', { extend: 'Ext.app.Controller', views: ['Documents'], stores: ['Documents'], models: ['Documents'], init: function() { console.log('[OK]
I have a controller something like this: Ext.define('DigitalPaper.controller.Documents', { extend: 'Ext.app.Controller', views: ['Documents'], stores:
I have a View (created using Backbone.View.extend) and a JSON object, I actually get
I have the following code: var GoalPanelView = Backbone.View.extend({ // Bind to the goal

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.