Reputation: 133
Controller
[HttpPost]
public ActionResult Index(string Name, int number)
{
Stored stored = new Stored();
var isValid = from c in _db.stored
where (c.Name == Name && c.Id == number)
select c;
if (isValid.Count() > 0)
{
return View("Index");
}
else if (isValid.Count() > 0 && c.hasExpired)
{
return RedirectToAction("Send", "Mail", new { theNumber = number });
}
else
{
return View("Index");
}
}
Target class
[HttpPost]
public ActionResult Send(int number)
Both have the HTTP Post attribute
Upvotes: 0
Views: 1712
Reputation: 283
check from Controller Name;
and you need to use [HTTPPOST] befor the function.
example :
[HTTPPOST]
public ActionResult Send(int number)
{
return RedirectToAction("Send", "Mail", new { theNumber = number });
}
Upvotes: -2