我的表单非常简单,只有一个对象,但是当我发布数据时,对象中的所有字段都是null
和0
。
[BindProperty]
public Person oPersonToDelete { get; set; }
public IActionResult OnPost()
{
Person oPD = oDb.Delete(oPersonToDelete.EmpId);
if(oPD != null)
{
return RedirectToPage("/Employees");
}
else
{
return RedirectToPage("/NotFound");
}
}