protected void Unnamed_Command(object sender, CommandEventArgs e) { if (ck.checkstringnull(txtName.Text) && ck.checkstringnull(txtAge.Text) && ck.checkstringnull(txtEmail.Text)) { if (ck.checkQuantity(txtAge.Text.Trim())) { if (ck.checkEmail(txtEmail.Text)) { if (FileUpload1.HasFile) { if (ck.CheckFileType(FileUpload1.FileName)) { string fileName = "images/Userimg/" + FileUpload1.FileName; string filePath = MapPath(fileName); FileUpload1.SaveAs(filePath); un.user_pro_image = FileUpload1.FileName; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your Image Is Too Large Or Not Format(.jpg|.png|.gif)')", true); load_us(); } } un.user_fullname = txtName.Text.Trim(); un.user_age = Convert.ToInt32(txtAge.Text.Trim()); un.user_email = txtEmail.Text.Trim(); cl.UpdateUser(un); load_us(); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Email Is Incorrect')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Age Is Incorrect')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Type Full Information ')", true); } }