There are different approaches to localizing an ASP.NET application. You can use a global resource file or local ones. The local resource files only applies to a single page or user control, whereas the global can be used from anywhere.

I’ve always used the global resource file located in the App_GlobalResources folder. I like that I can use all the text strings wherever I want. However, I have never used a local resource file for a specific page or user control for that very same reason.

Lately though, I’ve thought that the local resource file might be good for some specific scenarios. For instance if I know that a particular string is only going to be used on one specific page, then I don’t clutter the global resource file with page specific strings. However, then the information is spread over multiple files instead of just the global ones.

It reminds me about HTML style attributes and stylesheets. Is it ok to hardcode styles directly onto a page if the same style is not being implemented anywhere else? In my opinion yes, sometimes it makes sense, but I’m generally against it just like I’ve been against using local resource files.

Do you use local resources and if so, why have you chosen that instead of a global file?

Comments


Comments are closed