views:

46

answers:

2

I have around 60 controls and I want to show a tooltip for each of them.

I could do this manually but I want something that would allow me to make changes to the tooltip messages or the control they are bound to without modyfing the code (I don't know what this would be called).

I thought about XML, but is there a better to store simple data like this?

+2  A: 

If you wanted them to be user-configurable through an admin section I'd say put the text in a database.

Otherwise, I'd suggest putting it in resource files.

Jon Hanna
Initially, I would have said database, but unless you can build your app smart enough to pull back all the tooltips you need for one page, you are going to run any queries needed for the page data, plus one query per tooltip.
Josh
@Josh, there are ways and means to improve that (e.g. caching), but I'd go with the basic idea of db if I want it user-configurable. The alternative is to take the admin input and then rebuild the page (ick) config (double ick) or resource file (that one is only if you want to prove you can).
Jon Hanna
+3  A: 

I would recommend a custom configuration section. http://msdn.microsoft.com/en-us/library/2tw134k3.aspx. Then all you have to change are the values in the config file. You could even reference it as a separate file as to not clutter up your web.config.

Josh