我继承了实现自定义profile
提供程序的MOSS代码。设置似乎没问题(提供商& web.config)。为什么HttpContext.Current.Profile为NULL?它如何获得价值?
用户可以登录,但是登录后,HttpContext.Current.Profile
对象为空。为什么它是空的?如何/何时应该获得价值?
HttpContext.Current.User.Identity.Name
在洛后的值
我继承了实现自定义profile
提供程序的MOSS代码。设置似乎没问题(提供商& web.config)。为什么HttpContext.Current.Profile为NULL?它如何获得价值?
用户可以登录,但是登录后,HttpContext.Current.Profile
对象为空。为什么它是空的?如何/何时应该获得价值?
HttpContext.Current.User.Identity.Name
在洛后的值
麦克锋说:
通过配置文件提供,你必须加载从 SQL服务器配置表中的个人资料信息。
在WebProfile类 的GetProfile函数中传递UserName参数。这个类是由一个工具生成的。
http://social.msdn.microsoft.com/Forums/da-DK/netfxbcl/thread/af78e6c0-03f5-4f2d-ad07-dd2a57304377
尝试ProfileBase.Create(用户名,isAuthenticated)
public static System.Web.Profile.ProfileBase Create(string username, bool isAuthenticated) Member of System.Web.Profile.ProfileBase Summary: Used by ASP.NET to create an instance of a profile for the specified user name. Takes a parameter indicating whether the user is authenticated or anonymous. Parameters: username: The name of the user to create a profile for. isAuthenticated: true to indicate the user is authenticated; false to indicate the user is anonymous. Returns: A System.Web.Profile.ProfileBase object that represents the profile for the specified user.
什么ü想做的事,并在那里被执行的代码? –