As you have define two action method with same name,it get confuse about which method to call.
so of you put request first time and in controller you have two method with same name than it will show error like you are currently getting due to it try to find method with attribute HttpGet,but you have not mention that attribute on action method,now when you post your form at that time it will try to find method with HttpPost attribute and run that method,so you have to specify this two attribute on same method name
Try this
[HttpGet]
public ActionResult Admin()
{
var aux=db.UserMessages.ToList();
return View(aux);
}
[HttpPost]
public ActionResult Admin(int id)
{
var aux = db.UserMessages.ToList();
return View(aux);
}
您的路線是如何定義的? – MilkyWayJoe
請發佈錯誤 –