LoggedIn event is occurs after user authentication. Means I should be able to save user profile in LoggedIn event because user is authenticated before this event triggers. but still getting the error "This property cannot be set for anonymous users." what could be the reason?
protected void LoginUser_LoggedIn(object sender, EventArgs e) { string center_ID = HttpContext.Current.Profile.GetPropertyValue("centerID").ToString(); if (center_ID == "0") { string username = User.Identity.Name; Center c = new Center(); int centerID = c.admGetCenterIdByLoginName(username); HttpContext.Current.Profile.SetPropertyValue("centerID", centerID); HttpContext.Current.Profile.Save();//getting error here } }

Go to the complete details ...