简体   繁体   中英

Where is the best place to store user related data in asp.net?

When a customer logs in to my site, I need to know their account id and their menu id. This lets me know what data they can see on a page and what menu they get. I don't want to have to read this data over and over. Should I store this in a session variable or customize the membership user and membership provider to contain this information?

As already suggested, the profile system is super easy.

http://msdn.microsoft.com/en-us/library/2y3fs9xs.aspx

如果您要使用配置文件提供程序,请确保在运行高流量站点时查看本文的“优化ASP.NET 2.0配置文件提供程序”部分: http//www.codeproject.com /KB/aspnet/10ASPNetPerformance.aspx

配置文件系统可能适合您的需求。

I've used MS Table Profile Provider which allows you to specify your own database table structre to store the data rather than the XML schema used in the default profile system.

This has the added bonus of allowing you to write your own data access procedures for accessing common profile data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM