开发者

How can i inform ASP.NET that the a new User is created successfully?

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));
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜