//当用户创建成功后,触发此事件 protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) { string ChineseName, Gender, Love, work; WizardStepBase step = null; //获取指定的向导页 for (int i = 0; i < CreateUserWizard1.WizardSteps.Count; i++) { if (CreateUserWizard1.WizardSteps[i].ID == "PersonalInfo") { step = CreateUserWizard1.WizardSteps[i]; break; } } if (step != null) { //获取向导页中的值。 ChineseName = ((TextBox)step.FindControl("TextBox1")).Text; Gender = ((DropDownList)step.FindControl("DropDownList1")).SelectedValue; work = ((TextBox)step.FindControl("TextBox2")).Text; Love = ((TextBox)step.FindControl("TextBox3")).Text; Label1.Text = "个人信息如下:<br/>"; Label1.Text += "中文名称:" + ChineseName + "<br/>"; Label1.Text += "婚否:" + Gender + "<br/>"; Label1.Text += "职业:" + work + "<br/>"; Label1.Text += "爱好:" + Love + "<br/>"; } }
protected void RegisterUser_CreatedUser(object sender, EventArgs e) { // Find the correct wizard step WizardStepBase step = null; for (int i = 0; i < RegisterUser.WizardSteps.Count; i++) { if (RegisterUser.WizardSteps[i].ID == "NameStep") { step = RegisterUser.WizardSteps[i]; break; } } if (step != null) { _Firstname = ((TextBox)step.FindControl("FirstnameText")).Text; _Lastname = ((TextBox)step.FindControl("LastnameText")).Text; _Age = short.Parse(((TextBox)step.FindControl("AgeTExt")).Text); // Store the information Debug.WriteLine(string.Format("{0} {1} {2}", _Firstname, _Lastname, _Age)); } }