开发者

SqlProfileProvider - can you use Profile.GetProfile() in a project?

开发者 https://www.devze.com 2023-02-10 17:02 出处:网络
I am attempting to use the SqlProfileProvider in an application and can\'t seem to use it the way I want to.I would like to be able to simply call up a profile like this:

I am attempting to use the SqlProfileProvider in an application and can't seem to use it the way I want to. I would like to be able to simply call up a profile like this:

Profile p = Profile.GetProfile("naspinski开发者_开发技巧");
p.Organization = "new_org";

but I can't seem to find the correct way to use the GetProfile() that I seem to see scattered around the net. Is there a way to grab, read and modify profiles?

I am using it in MVC 3 and will not be actually logging in as the specific user, this will be pulling users from the db that are specified. Thank you.


To retrieve the profile:

var profile = ProfileBase.Create(HttpContext.Profile.UserName, true);

And here's the MSDN documentation. And a nice blog post about custom profiles.

0

精彩评论

暂无评论...
验证码 换一张
取 消