Try our conversational search powered by Generative AI!
AI OnAI Off
if( UnifiedPrincipal.Current.Identity.IsAuthenticated )
{
PersonalizedData pd = UnifiedPrincipal.Current.UserData;
pd["ShoeSize"] = "8.5";
pd["FavouritePet"] = "Cat";
pd.Save():
}
Regards,
Johan Olofsson
string url = HandleLogin(); if (url != null) { IPrincipal principal; principal = AuthenticationProvider.Authenticate(this, Username.Text, Password.Text); HttpContext.Current.User = principal; // try and set current user in code CurrentUser.UserData["MyField"] = MyField.Text; CurrentUser.UserData.Save(); // this doesn't save PersonalizedData.Load(Username.Text); // try and populate PersonalizedData PersonalizedData.Current["MyField"] = MyField.Text; PersonalizedData.Current.Save(); // this doesn't save either Response.Redirect(url); // normal login redirect }
As you can see from my comments, the two methods I've tried to set custom data for the user don't work. Can anybody help? Thanks, /\dam