Hi everyone,
I've made a membership by create user wizard. everything is good but after click on finish register button, when page redirect to index .aspx, this page thinks tht user logged in. whereas user didnt login just added to DB.
here is the code:
protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs args)
{
try
{
Membership.CreateUser(CreateUserWizard1.UserName, CreateUserWizard1.Password, CreateUserWizard1.Email);
Response.Redirect("index.aspx");
}
catch (MembershipCreateUserException e)
{
Literal errormessage = (Literal)CreateUserWizard1.WizardSteps[0].Controls[0].Controls[0].Controls[0].Controls[0].FindControl("ErrorMessage");
errormessage.Text = GetErrorMessage(e.StatusCode);
}
}
in index.aspx just have a login name and login status control. tht's it.
what is the solution?