Configuration involves a number of steps. Because a database provider requires a database connection and a few other settings setup for this provider requires a few steps:

  • Installing the Westwind.Globalization assembly
  • Configuring the custom Resource Provider in web.config
  • Setting permissions to allow resource editing
  • Creating the Resource table in your database
  • Importing any .Resx Resources (required!)
  • Enabling the wwDbResourceProvider as an ASP.NET provider

To use the DbResourceProvider you need to include the Westwind.Globalization assembly in your bin directory or by deploying into the GAC. The assembly is self contained and has no further requirements for provider operation. The Admin interface requires that the LocalizeAdmin directory is copied to your Web site and Westwind.Web.Controls.dll is deployed.

The provider works by using a single database table to store all resources. The database table must be created and this can be done through the administration interface. You can run the Administration page and if the resource table doesn't exist an option to generate is available.

Please make sure that you run the administration interface to create the resource database and import Resx resources before enabling the resource provider with ASP.NET. If you don't do this first there will be no resource data and your UI will show blanks instead of localized data.

Before you can use the provider or even create the database however the provider must be configured. The wwDbResourceProvider is configured via a web.config DbResourceProvider section which contains the basic configuration settings for the operation of the provider. These settings are read when the provider is first accessed and contains vital information like the database connection string and how resource editing is performed.

The most important setting in the configuration is the connection string which should point to any database of your choice. Note that if you plan to create the database make sure you connect to the database with an account that has writes to create a table, at least until you've created the table. If you plan on administrating Resources the account in use must also be able to read/write/update/delete the localization table.

The provider also includes a wwDbResourceConfiguration class that exposes all of the key configuration values. At any point in the application the DbResourceConfiguration.Current property contains the current configuration that is internally used by the resource provider and all of the related classes.