ashx页面中调用自定义的Profile

来源:互联网 发布:类似双程的网络剧 编辑:程序博客网 时间:2024/06/06 03:28

在使用ashx页面处理数据时,如果你要使用Profile中自定义Profile会遇到一些麻烦,如果没有研究甚至会放弃使用ashx而改用aspx。

其实要在ashx页面访问自定义的Profile也是很简单额如:

 ProfileCommon pc = (ProfileCommon)context.Profile;
  pc = pc.GetProfile(context.Profile.UserName);
  string unitGroupID = pc.ProfileUserInfo.UnitGroup_ID;

   ProfileUserInfo userInfo = context.Profile.GetPropertyValue("ProfileUserInfo") as ProfileUserInfo;

 

 

原创粉丝点击