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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:27:25+00:00 2026-05-27T08:27:25+00:00

I created an NinjectResolver which implements IDependencyResolver. In the global.asax, I’m setting this guy

  • 0

I created an NinjectResolver which implements IDependencyResolver. In the global.asax, I’m setting this guy as my DependencyResolver.

However, in doing so, I lose all of my data-dash attributes on validaiton. And it also messes up the entire client-side paging, sorting on my grid (using Telerik’s MVC extensions).

Here’s the class:

public class NinjectResolver : IDependencyResolver
{
    private readonly IKernel _kernel;

    public IKernel Kernel
    {
        get
        {
            return _kernel;
        }
    }

    public NinjectResolver(params Ninject.Modules.INinjectModule[] modules)
    {
        _kernel = new StandardKernel(modules);
    }

    public object GetService(Type serviceType)
    {
        return _kernel.TryGet(serviceType);
    }

    public IEnumerable<object> GetServices(Type serviceType)
    {
        return _kernel.GetAll(serviceType);
    }

    public IBindingToSyntax<T> Bind<T>()
    {
        return _kernel.Bind<T>();
    }
}

And here’s my app start in global.asax …

    protected void Application_Start()
    {
        .... omitted

        var modules = new Ninject.Modules.INinjectModule[] 
        { 
            new PersistenceModule()
        };

        var dependencyResolver = new NinjectResolver(modules);
        DependencyResolver.SetResolver(dependencyResolver);

        .... omitted
    }

If I comment out the SetResolver line, all my client-side validation works as well as my client-side grid sorting, paging, filtering, etc. Unfortunately, I lose all my constructor injection.

Any help is appreciated please. Not sure if I have to add more modules for client side operations to work?

Please advise.

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

    Why don’t you use https://github.com/ninject/ninject.web.mvc/wiki/MVC3 instead of writing your own implementation? It is widely used and proven to work in many projects.

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

Sidebar

Related Questions

I created a program using dev-cpp and wxwidgets which solves a puzzle. The user
I created the register form in asp.net. And I want to validate Name. This
I created a class extending Application to have global variables in my app. I
I Created a wrapper for Ninject DI container which I intend to use in
Created a new App, created a new Fanpage for this App but if i
I created a document management system for a client which uses SharePoint and SQL
I created a Java application which is the only application active on a workstation.
i created web project, and added new class library for framework. This framework includes
Created BroadcastReceiver which displays application name and version number on install/ uninstall of any
Created javascript widget. Testing on my own domain and its working fine. However when

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.