I stumbled upon this project ASP.NET WebProfile Generator
Why would I need proxy class to开发者_JAVA百科 access profile?
Because ASP.NET only supports Profiles out-of-the-box with the Web Site option. If you are using a Web Application Project (WAP), then you have to roll your own.
The problem stems from the fact that the Web Application Project does not have the Profile object automatically added to each page as with the Web Site project, so we cannot get strongly-typed programmatic access to the profile properties defined in our web.config file.
Good news is that it's very doable:
- ASP.NET: Web Site versus Web Application Project
- How to add a Login, Roles and Profile system to an ASP.NET 2.0 app in only 24 lines of code
- Web Profile Builder
- Web Profile Builder for Web Application Projects
- Writing a custom ASP.NET Profile class
- ASP.NET Profiles in Web Application Projects
精彩评论