ASP.Net MVC action to support the Get method

method one:

AcceptVerbs label applied on the method of action,

Example:

[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]

public ActionResult Index()

 

Method Two:

 

Controller code

When the action method returns json data, add JsonRequestBehavior.AllowGet parameters,

Example:

  return Json (new {result = 1, message = "message content"}, JsonRequestBehavior.AllowGet);

 

Guess you like

Origin www.cnblogs.com/stone2012/p/11444869.html