如何使用asp.net存储工具提示消息?

时间:2022-12-08 13:06:37

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

我有大约60个控件,我想为每个控件显示一个工具提示。

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?

我考虑过XML,但是是否有更好的方法来存储这样的简单数据呢?

2 个解决方案

#1


3  

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.

我推荐一个自定义配置部分。http://msdn.microsoft.com/en-us/library/2tw134k3.aspx。那么您只需更改配置文件中的值。您甚至可以将它作为一个单独的文件引用,以避免web.config造成混乱。

#2


3  

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.

否则,我建议把它放到资源文件中。

#1


3  

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.

我推荐一个自定义配置部分。http://msdn.microsoft.com/en-us/library/2tw134k3.aspx。那么您只需更改配置文件中的值。您甚至可以将它作为一个单独的文件引用,以避免web.config造成混乱。

#2


3  

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.

否则,我建议把它放到资源文件中。