我继承了实现自定义 profile
提供程序的 MOSS 代码。设置似乎没问题(提供商和 web.config)。
用户可以登录,但是登录后,HttpContext.Current.Profile
对象为空。为什么它是空的?应该如何/何时获取值?
HttpContext.Current.User.Identity.Name
登录后有值
最佳答案
麦克冯说:
Through Profile provider you have to load the Profile information from SQL server profile table .
Pass the UserName parameter in GetProfile function of WebProfile class . This class is generated by a tool .
http://social.msdn.microsoft.com/Forums/da-DK/netfxbcl/thread/af78e6c0-03f5-4f2d-ad07-dd2a57304377
关于c# - 为什么 HttpContext.Current.Profile 为 NULL?它如何获得值(value)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13396730/