In my webpage i use a combination of the CreateUserWizard
and a custom validation module.
Fortunately OR unfortunately the CreateUserWizard
control sees that the user is not created successfully and displays the following message (although the user is added successfully as record, in my MS-SQL database).
Your account was not created. Please try again.
How can i inform the ASP.NET that the user is created successfully, so instead of the the message mentioned above, the user will be forwarded to the ContinueDestinationPageUrl
of the CreateUserWizard
contr开发者_开发知识库ol?
Use CreatedUser
event.
Markup:
<asp:CreateUserWizard runat="server" ID="wizardAddUser" OnCreatedUser="wizardAddUser_CreatedUser">
...
</asp:CreateUserWizard>
Code-behind:
protected void wizardAddUser_CreatedUser(object sender, EventArgs e)
{
CreateUserWizard wizardAddUser = (CreateUserWizard)sender;
Response.Redirect(String.Format("~/{0}?user={1}", "Default.aspx", wizardAddUser.UserName));
}
精彩评论