views:

266

answers:

2

Hi there, in some projects (web application projects) I'm using global resource files. (Stored in the App_GlobalResources folder)

pro: Really easy to use: e.g. in the markup

Property="<%$ Resources:FILENAME, KEY %>"

con: - As far as I know, I can't change the content of the resources on the fly. So if a customer is calling and tells me to change a string in the french implementation, I need to deploy a new binary. While using SessionMode="InProc" that might lead to undesired behaviour, like session loss etc.

I'd rather change a line in an XML file, to ensure maximum uptime of the application. I think It would be possible to write one's own localization class, that implements an XML file as underlying datasource (using caching etc.). So the question is, is there any upside in doing so?

Can anybody tell me more pros or cons for using global resource files? (And I'm still listening to suggestions to change resource files in a running web application ;) )

So what benefits do I have by using global resources?

Edit: I'd like to stick to "build-in" solutions in Visual Studio or the .net framework, rather than using a (unknown) 3rd party library.

A: 

Global resources allow to localize your web application. You can have global resource per language you need to support and you will not have to duplicate aspx files. It will also allow users to switch to the language they wish at runtime.

See here:

Walkthrough: Using Resources for Localization with ASP.NET
ASP.NET Web Page Resources Overview

Giorgi
Yeah, well I know how localization works. Please read my question again.
citronas
User can switch between languages at runtime without any modification of code.
Giorgi
+2  A: 

It's provider model, so you can change the data source. For instance, you can store the resource on the database which is better for data driven applications. Because, you can edit, cache, install and update them simply. Visit here.

Mehdi Golchin
Thanks, your awnser is poiting into the anticipated direction. If I understand the link you posted correctly, then the developer wrote an own DDL to achieve the localization on a DB basis. If possible, I'd like to use "build-in" framework features.
citronas
Yes, It's better to use available features. And you don't need any 3rd party library in this case. As far as I said, you can write your own resource provider to use database instead of resource file. Thus, you can do anything you want.
Mehdi Golchin
Ok, then I'll look further into it =)
citronas