protected void save_Click(object sender, EventArgs e) { try { string path = Server.MapPath(@"../Image/User/" + fileup.FileName); fileup.SaveAs(path); photo.ImageUrl = @"../Image/User/" + fileup.FileName; BLL_Users bu = new BLL_Users(); Users u = new Users(); u.U_ID = Convert.ToInt32(id.Text); u.U_IMG = photo.ImageUrl; u.U_NAME = name.Text; u.U_PASSWORD = FormsAuthentication.HashPasswordForStoringInConfigFile(pass.Text, "MD5"); u.U_EMAIL = email.Text; bu.UpdateUsers(u); if (bu.UpdateUsers(u) > 0) { Response.Write("<script>alert('修改成功!');</script>"); } else { Response.Write("<script>alert('修改失败!');history.go(-1);</script>"); } } catch { Response.Write("<script>alert('修改失败!');history.go(-1);</script>"); } }