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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:57:41+00:00 2026-05-23T08:57:41+00:00

I have a new MVC3 application with a few legacy Web Form pages. I’m

  • 0

I have a new MVC3 application with a few legacy Web Form pages. I’m familiar with with Ninject and MVC but I want to use Ninject with the Web Form pages as well. I’ve hacked something together but I’m not sure if it’s the right way to go about this.

I’ve exposed the Ninject kernel as follows:

public static IKernel Kernel { get { return CreateKernel(); } }

private static IKernel CreateKernel()
{
    var kernel = new StandardKernel();
    RegisterServices(kernel);
    return kernel;
}

I then created a base class for my Web Form pages that injects the kernel:

public class NinjectBase : Page
{
    public IKernel Kernel { get; private set; }
    public NinjectBase() { Kernel = NinjectMVC3.Kernel; } 
    public void Page_Init() { Kernel.Inject(this); }
}

This seems to work well enough. Is there anything wrong with this approach? Is there another way I should be going about this?

  • 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-23T08:57:41+00:00Added an answer on May 23, 2026 at 8:57 am

    Ninject 2.4 will support all the web technologies (ASP.NET, MVC, WCF) side a side.

    If you are not yet on production go and get 2.3.0.x

    • the source from Github: https://github.com/ninject
    • or binaries from the Continuous Integration Server at http://teamcity.codebetter.com

    You will need Ninject, Ninject.Web, Ninject.Web.Common, Nnject.Web.MVC3

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

Sidebar

Related Questions

I'm somewhat new to MVC3, so I have a few questions... I am creating
I am new to ASP.NET MVC 3 and I want to have username/id as
I made a similar question a few days ago, but now I have new
I have an ASP.Net MVC 3 web application and I am adding a check
I have a properly working ajax form in my MVC3 application except for one
I have a simple MVC 3 application. I want the site to automatically redirect
I have an ASP.NET MVC 3 / .NET Web Application, which is heavily data-driven,
I'm a bit new to SSRS... I have an MVC3 application which I need
I have MVC3 application with SSL. I want particular page URL should always add
I have developed a MVC3 application in that I want use the Check boxlist

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.