Wiki Link: [discussion:20291]
Extra Method  


Jan 11 2008 at 3:22 PM
Hi,
Could you modify WebProfile Generator to create the following method

public virtual WebProfile GetProfile(string username, bool authenticated)
{
return new WebProfile(System.Web.Profile.ProfileBase.Create(username, authenticated));
}

I am doing

public void Profile_OnMigrateAnonymous(Object sender,
ProfileMigrateEventArgs args)
{
WebProfile Profile = new WebProfile(Context.Profile);
// get the anonymous user's profile
WebProfile anonymousProfile = Profile.GetProfile(args.AnonymousID);

which always returns an uninitialised anonymousProfile.
I tried doing anonymousProfile.Initialize(args.AnonymousID, false);
but this doesn't work.
The only thing that does work is
WebProfile anonymousProfile = Profile.GetProfile(args.AnonymousID, false);
but this means manualy editing the WebProfile.cs file :-(

I am using the XmlProvider Library 1.0.0.5a

TIA Chris

Feb 3 2008 at 9:40 PM
Chris,
This method has been added in an upgraded solution called Web Profile Builder.
http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx

Updating...
© 2006-2009 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2009.10.27.15987