[英]CreateUserWizard step changing issue after account creation
I want to change the createuserwizard.step= start if the mail sending fails and not to go to successful creation step. 我想更改createuserwizard.step = start如果邮件发送失败而不是成功创建步骤。
catch (SmtpException ex)
{
Membership.DeleteUser(textboxemail.Text.Trim());
Literal errorMessage=(Literal) CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ErrorMessage");
errorMessage.Text = "Account creation failed due to email notification."+ ex.Message + " errorcode" +ex.StatusCode + "; inner exception; " + ex.InnerException;
CreateUserWizard1.CreateUserStep.StepType = WizardStepType.Start;
}
but the exception says the steptype can't be changed. 但例外情况说steptype不能改变。 So how to do this.
那怎么做呢。 I mean to stop from going to success step.
我的意思是停止走向成功的一步。
You are getting that exception because you need to use the Wizard.MoveTo method . 您将获得该异常,因为您需要使用Wizard.MoveTo方法 。
Like this: 像这样:
CreateUserWizard1.MoveTo(WizardStep1);
Where "WizardStep1" is the ID of the asp:WizardStep
that you want to go back to (the "start" step). 其中“WizardStep1”是您想要返回的
asp:WizardStep
的ID(“开始”步骤)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.