views:

4

answers:

0

Hi I am a beginner in MVC 2 and I was going through the ScottGu's blog for deleting a record from database using entity framework. I don't understand the use of string confirmButton(name of button tag in View template) as one of the parameter for Delete action method in the following code. Can any one tell me why it is used ?

// // HTTP POST: /Dinners/Delete/1

[AcceptVerbs(HttpVerbs.Post)]

public ActionResult Delete(int id, string confirmButton) {

Dinner dinner = dinnerRepository.GetDinner(id);

if (dinner == null) return View("NotFound");

dinnerRepository.Delete(dinner); dinnerRepository.Save();

return View("Deleted");

}