如果邮件发送失败,我希望更改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;
}但是异常说明了steptype不能被改变。那么如何做到这一点呢?我的意思是停止前进到成功的一步。
发布于 2013-07-02 21:40:17
您将获得该异常,因为您需要使用Wizard.MoveTo method。
如下所示:
CreateUserWizard1.MoveTo(WizardStep1);其中"WizardStep1“是要返回的asp:WizardStep的ID ( "start”步骤)。
https://stackoverflow.com/questions/17424845
复制相似问题