locked
Generating global resources file RRS feed

  • Question

  • User-1526035670 posted
    Hi

    I've seen a few articles where you can create local files using the Tools menu (generate local resource) which in turn gets the aspx control on the form and adds it's code to display according to the web browser language setting.

    Is there a way to do the same for Global Resource files? I have a number of controls so don't fancy doing this manually?
    Monday, March 30, 2020 2:46 PM

All replies

  • User475983607 posted

    Is there a way to do the same for Global Resource files? I have a number of controls so don't fancy doing this manually?

    Yes, the standard docs cover global resource files.

    https://docs.microsoft.com/en-us/previous-versions/aspnet/ms227427(v%3Dvs.100)

    Creating Resource Files for ASP.NET Web Sites

    In ASP.NET, you can create resource files that have different scope. You can create resource files that are global, which means that you can read the resource file from any page or code that is in the Web site. You can also create local resource files, which store resources for a single ASP.NET Web page (.aspx file).

    Global Resource Files

    You create a global resource file by putting it in the reserved folder App_GlobalResources at the root of the application. Any .resx file that is in the App_GlobalResources folder has global scope. Additionally, ASP.NET generates a strongly typed object that gives you a simple way to programmatically access global resources.

    Monday, March 30, 2020 3:56 PM
  • User-1526035670 posted
    Hi

    Perhaps I'm missing something here but after reading that documentation, I fail to understand if I have 10 controls on my form how I could generate all 10 controls with the appropriate fields within the aspx page as well as within my resx file? I'm trying to replicate the local resource process but for global files?
    Monday, March 30, 2020 6:42 PM
  • User475983607 posted

    I do not understand the problem you are trying to solve.  ASP.NET Web Forms has a global resource file which is global to the entire application.  There are also resource files that go with the pages.  Each page has it's own resource file.  

    Can you explain what the following means?  What is a global file in your application?

    I'm trying to replicate the local resource process but for global files?

    Monday, March 30, 2020 7:15 PM
  • User-1526035670 posted
    Hi

    What I was trying to achieve was the code generated like local resource tool does for the controls.

    I assume I can't?
    Thursday, April 2, 2020 11:40 AM
  • User475983607 posted

    What I was trying to achieve was the code generated like local resource tool does for the controls.

    I assume I can't?

    I'm not aware of a tool that has this feature.

    Thursday, April 2, 2020 11:49 AM