asp.netlocalizationwebformsglobalizationaspnet-merge

Tricky problem with ASP.NET web forms resources and localization


I've got the following nonstandard setup (VS2008, .NET 3.5 SP1):

There is a main web project called MainSite and There are several "plugin" web projects with different names.

When building these plugins I have a custom build step that calls aspnet_compiler.exe and aspnet_merge.exe. This results in two .DLL files - plugin_name.dll and plugin_name_deploy.dll. The first one contains the codebehind classes, the second one contains code generated from .ascx files.

These plugin .DLL's are then copied to /MainSite/bin/Plugins/ folder. At runtime (application startup) MainSite application looks in this folder and dynamically loads all the .DLL files there.

All my forms are in the plugins, in .ascx files. The main application is just a skeleton which loads these .ascx usercontrols as needed.

And now comes the need for localization. Ideally I would like to have the following:

Any ideas on how to achieve this?


Solution

  • Apparently it is possible to implement custom resource providers in .NET. Here is an article that contains links to various other articles that explain the whole process. In effect, you take the value from meta:resourcekey and get the value from wherever you want. The article above, for example, stores all localization information in a DB.