发现了:)
在“创建用户向导”控件上添加对函数的引用
OnCreatedUser
:
<asp:CreateUserWizard
id="CreateUserWizard1"
Runat="server"
OnCreatedUser="CreatedUser"
然后在代码中定义要运行的功能:
protected void CreatedUser(object sender, EventArgs e)
{
Response.Redirect("viewBasket.aspx?action=news");
}
protected void CreatedUser(object sender, EventArgs e)
{
TextBox userNameTextBox = (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName");
MembershipUser user = Membership.GetUser(userNameTextBox.Text);
FormsAuthentication.SetAuthCookie(userNameTextBox.Text, false);
Response.Redirect("viewBasket.aspx?action=news");
}