@model Buoi1.Pages.MH_Sua_SanPham
ViewData["Title"] = "Home page";
string Chuoi = string.Empty;
string masp = Request.Query["masp"];
if (string.IsNullOrEmpty(masp))
Chuoi = "Ma san pham khong hop le";
s = XL_SANPHAM.DocSanPham(masp);
Chuoi = "Khong tim thay san pham";
Chuoi = $"Ban co muon xoa san pham {s.Value.TenSP} khong?";
if (Request.Method == "POST")
newMaSP = Request.Form["newMaSP"];
newTenSP = Request.Form["newTenSP"];
newGia = int.Parse(Request.Form["newGia"]);
XL_SANPHAM.SuaSanPham(masp, newMaSP, newTenSP, newGia);
Response.Redirect("/MH_HienThi_SanPham");
<title>Sửa thông tin sản phẩm</title>
<h1>Sửa thông tin sản phẩm</h1>
<td><input type="text" id="newMaSP" name="newMaSP" value="@s.Value.MaSP"></td>
<td><input type ="text" id="newTenSP" name="newTenSP" value="@s.Value.TenSP" /></td>
<td><input type ="text" id="newGia" name="newGia" value="@s.Value.Gia" /></td>
<input type = "submit" value="Sửa">
public static void SuaSanPham(string masp, string newMaSP, string newTen, int newGia)
LT_SANPHAM.SuaSanPham(masp, newMaSP, newTen, newGia);
public static void SuaSanPham(string masp, string newMaSP, string newTen, int newGia)
SanPham[] ds = DocDanhSach();
for (int i = 0; i < ds.Length; i++)
if (ds[i].MaSP.Equals(masp))