bicycle
bicycle

Reputation: 8432

Best practice storing language variables in asp.net

Given a certain asp.net (or any other language for that matter) website where you want the language strings to be stored together instead of hard-coding them within the aspx page. My friend says you need to store them all in the Web.config. I think the web.config is not made for that and doesn't make sense to put it there. If you have a website containing 2000 language strings in three languages, the webconfig would contain 6000 entries. I think it's better to store them in a table in a database but he doesn't believe me, who's right?

Upvotes: 0

Views: 140

Answers (2)

Artless
Artless

Reputation: 4568

No, they should not be stored in the web.config. Neither should they be in the database, it's a waste of your DB processing power and bandwidth. A better way would be to use resource files. See this article about ASP.NET localization: link

Upvotes: 1

Darren Kopp
Darren Kopp

Reputation: 77627

Database is better than web.config for sure, but I would suggest looking into the built-in resource functionality before going and making your own system.

Upvotes: 2

Related Questions