我该如何告知用户新用户成功创建ASP.NET?我该、新用户、用户、NET

2023-09-03 22:42:03 作者:左音

在我的网页我使用的组合的CreateUserWizard 和一个自定义验证模块。

In my webpage i use a combination of the CreateUserWizard and a custom validation module.

是幸运还是不幸的的CreateUserWizard 控制的看到的用户是不是成功创建并显示以下信息(尽管用户被成功地为加入记录,在我的MS-SQL数据库)。

Fortunately OR unfortunately the CreateUserWizard control sees that the user is not created succesfully and displays the following message (although the user is added succesfully as record, in my MS-SQL database).

您的帐户不被创建。请重试。

我该如何告知,用户将被转发到 ContinueDestinationPageUrl 的用户成功创建ASP.NET,所以不是上述消息的CreateUserWizard 控制?

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 control?

推荐答案

使用 CreatedUser 事件。

标记:

<asp:CreateUserWizard runat="server" ID="wizardAddUser" OnCreatedUser="wizardAddUser_CreatedUser">
    ...
</asp:CreateUserWizard>

code-背后:

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