nizam nizam

nizam nizam

  • NA
  • 0
  • 12.3k

MVC4: The resource cannot be found

Feb 26 2015 4:42 AM

The resource cannot be found.

what is this error while i deleting a list  
//Get//
public ActionResult Delete(int id=0)
{
var head = db.Payroll_SalaryHeads.Find(id);
if (head == null)
{
return HttpNotFound();
}
return RedirectToAction("Index");
}

..POST// 
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult Delete(int id=0)
{
var head = db.Payroll_SalaryHeads.Find(id);
db.Payroll_SalaryHeads.Remove(head);
db.SaveChanges();
return RedirectToAction("Index");
}
 

Answers (1)