Пример #1
0
 protected void Update_Click1(object sender, EventArgs e)
 {
     if (Userpassword.Text.Trim() == Userpassword2.Text.Trim())
     {
         Users users = new Users();
         users.Users_Name1     = UserName.Text.Trim();
         users.Users_Password1 = Userpassword2.Text.Trim();
         users.Users_Tel1      = Userphone.Text.Trim();
         users.Users_Img1      = @"~/Img_Users/" + FileUpload_img.PostedFile.FileName;
         if (UsersBll.usersupdate(users) == 1)
         {
             Session["img"] = @"~/Img_Users/" + FileUpload_img.PostedFile.FileName;
             Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('修改成功!');</script>");
         }
         else
         {
             Page.ClientScript.RegisterClientScriptBlock(typeof(object), "alert", "<script>alert('修改失败!');</script>");
         }
     }
     else
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(object), "alert", "<script>alert('前后密码不一致失败!');</script>");
     }
 }