ASP.NET – Use the .resx file to get global application messages?

So I use global resource files in my website to handle all static messages. Mainly error messages, etc.

They don’t need to be localized, But I think it’s a good idea to store them all in one place.

Is it better to use a static class called “SiteConstants” or something? Or are you using RESX files?

Thank you!

Use resource files absolutely.

The .resx file will be You create the class. But the most important thing is that the automatically generated code already provides you with all the localized things. If you decide to localize your application, if you use the specified file/folder structure, it will also be automatically supported The application. Not to mention that localizing your application is just a translation issue, which is the best case (other localization issues such as currency are not mentioned, which is a completely independent issue).

So I use global resource files in my website to handle all static messages. Mainly error messages, etc.

They do not need to be localized, but I Think it’s a good idea to store them all in one place.

Is it better to use a static class called “SiteConstants” or something? Or are you using RESX files?

Thank you!

Absolutely use resource files.

. The resx file will create the class for you. But most importantly, it is automatically generated The code already provides you with all the localization stuff. If you decide to localize your application, if you use the specified file/folder structure, the application will also be automatically supported. Not to mention localizing your application It’s just a translation issue, this is the best case (other localization issues are not mentioned, such as currency, which is a completely independent issue).

Leave a Comment

Your email address will not be published.