locked
Problem with compiling web pages with custom resource manager RRS feed

  • Question

  • User-32408663 posted

     I have a database resource provider factory that I want to use instead of the ResxResourceProviderFactory. I have a problem with the files that get compiled into the Temporary ASP.NET Files directory for the web site. Here is the issue:

    • On a web page in design mode choice 'Generate Local Resources' so all of the meta: stuff is created.
    • Make a copy of the webpage.aspx.resx file and rename it to webpage.aspx.es-mx.resx file
    • Translate the strings in the copied file to Spanish-Mexican strings.
    • Delete all of the files in Temporary ASP.NET Files/MyWebSite
    • Run in debug mode from VS2005.

    This works as expected. Now if I do this it works too.

    • Add a <globalization  resourceProviderFactoryType="<namespace>.<class>, <assembly>" /> in the system.web section of web.config
    • Run in debug mode from VS2005.

    This works as expected and now the strings are coming from the database. This doesn't work:

    • Delete all of the files in Temporary ASP.NET Files/MyWebSite to force a compile.
    • Run in debug mode from VS2005

    This doesn't work. If I go and look at the auto-generated web page in the Temporary ASP.NET Files/MyWebSite I notice that the .Text is only being set once.

    @__ctrl.Text = "English String"

    The @__ctrl.Text = System.Convert.ToString(this.GetLocalResouceObject("resourcekey"), CultureInfo.CurrentCulture) is missing.

    If I remove the <globalization  resourceProviderFactoryType="<namespace>.<class>, <assembly>" /> from the web.config file and delete the files out of the Temporary ASP.NET Files/MyWebSite directory and use the default ResxResourceProviderFactory then the @__ctrl.Text = System.Convert.ToString(this.GetLocalResouceObject("resourcekey"), CultureInfo.CurrentCulture) is there and I can re-add the <globalization  resourceProviderFactoryType="<namespace>.<class>, <assembly>" /> to the web.config and it works.

    Does anyone know why when I have the <globalization  resourceProviderFactoryType="<namespace>.<class>, <assembly>" /> in the web.config file and have to re-generate the web pages in Temporary ASP.NET Files/MyWebSite that the @__ctrl.Text = System.Convert.ToString(this.GetLocalResouceObject("resourcekey"), CultureInfo.CurrentCulture) isn't there?

    I can't figure out this one.  Am I missing something here?

    Wednesday, June 27, 2007 4:39 PM

All replies

  • User-32408663 posted

    I forgot to state that my browser setting for Language is Spanish-Mexico [es-mx] as the top one and not English [en] or some other language choice. 

    Wednesday, June 27, 2007 5:02 PM