Friday 18 August 2017

GET and POST to same Controller Action in ASP.NET MVC.



This is possible using the AcceptVerbs attribute. It’s a bit more verbose but more flexible.
[AcceptVerbs(HttpVerbs.Get|HttpVerbs.Post)]
public ActionResult Index()
{
                    // Code goes here
}

No comments:

Post a Comment