protected void btn_Them_Click(object sender, EventArgs e) { string type_name = txtName.Text; int type_pos = Convert.ToInt32(txt_pos.Text); DateTime modified = DateTime.Parse(txt_Ngay.Text); int status = Convert.ToInt32(txt_status.Text); string username = txt_username.Text; string path = Server.MapPath("~/admin/img/"); string filename = FileUpload1.FileName; FileUpload1.SaveAs(path + filename); FoodType food = new FoodType(type_name, type_pos, filename, status, username, modified); if (food.AddFoodType()) { ClientScript.RegisterStartupScript(this.GetType(), "randomkey", "alertSuccess()", true); } else { } }