Is is possible to programmatically change the resourceProviderFactoryType?

Posted by Robert Massa on Stack Overflow See other posts from Stack Overflow or by Robert Massa
Published on 2010-04-27T06:58:44Z Indexed on 2010/04/27 7:03 UTC
Read the original article Hit count: 378

I have a custom implementation of IResourceProvider and ResourceProviderFactory. Now the default way of making sure ASP.NET uses these custom types is to use the web.config and specify the factory like so:

<globalization resourceProviderFactoryType="Product.Globalization.TranslationResourceProviderFactory" />

This works perfectly, except that in my resource provider I need database access. I want to use my IoC-container(Ninject) to inject the repositories needed to access this data into the CustomResourceProvider. But how am I going to do this? I have no control over the instantiation of the factory, so the factory can't get a reference to my IoC.

Is there any way to register a custom provider programmatically, in for example the Global.asax?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about globalization