protected void Reg_Click(object sender, EventArgs e) { Ma.username = this.UserName.Text.Trim(); Ma.password = FormsAuthentication.HashPasswordForStoringInConfigFile(this.UserPwd1.Text.Trim(), "MD5"); Ma.useremail = this.email.Text.Trim(); Ma.aleave = "普通用户"; if (Ba.AddUser(Ma)) { Response.Write("<script language=javascript>alert('注册成功!')</script>"); } Session["username"] = Ma.username.ToString(); Response.Redirect("UserCenter.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { Ma.username = this.UserName.Text.Trim(); Ma.password = FormsAuthentication.HashPasswordForStoringInConfigFile(this.UserPwd.Text.Trim(), "MD5"); Ma.useremail = this.UserEmail.Text.Trim(); Ma.aleave = this.DownListAleave.SelectedValue.Trim(); if (ba.AddUser(Ma)) { Response.Write("<script language=javascript>alert('添加成功!')</script>"); } tb.Visible = false; LoadData(); }