views:

29

answers:

0

Hi

Using a CreateUserWizard (with only one step) and a logincontrol on the same page.

But when i create a new user the Remeber me functionality dosent work (only if i log out and then log in again). I dont know if the persistant cookie is created.

Im using this code behind:

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
    // Sets username into email
    CreateUserWizard cuw = (CreateUserWizard)sender;
    cuw.Email = cuw.UserName;

    // Saves profile data        
    ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);
    p.city = "";
    p.displayName = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("displayName")).Text;
    p.Save();


    FormsAuthentication.SetAuthCookie(cuw.UserName, true);

}

Is this suposed to work? Cheers! Johan