在哪里存储全局设置,以允许应用程序频繁访问它们,而不会给数据库带来很大的开销
我的应用程序中有一些全局设置,将由管理员处理,并将它们存储在数据库中。
设置如下:板开/关、不同用户控件上的最大项目/页面、语言、隐藏/显示模块。
我应该遵循什么技术来读取数据库中的值并根据它显示页面或应用程序..当然我可以用简单的方法来做到这一点并在 Page_Load 事件处理程序中获取每个页面所需的设置,但我认为会出现很多数据库连接!
有没有更好的方法来实现这一目标?
I have some global settings in my application that is going to be handled by the administrator and I store them in the database.
Settings like: board on/off, max items/page on different UserControls, language, hide/show modules.
What technique should I follow to read the values in the database and display the page or the application according to it .. Of course I could do it the easy way and fetch the required settings for each page in the Page_Load event handler but I think that will be a lot of database connection!
Is there is any better way to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能希望将设置加载到应用程序状态 在
global.asax
中的Application_Start
上。You probably want to load your settings into the Application state on
Application_Start
in yourglobal.asax
.