//In Controller this is what I have
public class AjaxController : Controller
{
[AcceptVerbs(new string[]{"GET"})]
public ActionResult FindRooms(string selectedBuilding)
{
return Json(new { Room = "x"}, JsonRequestBehavior.AllowGet);
}
}
//In Global.asax.cs I have
routes.MapRoute
(
"AjaxRoute1",
"Ajax/FindRooms/{selectedBuilding}",
new { controller = "Ajax", action = "FindRooms", selectedBuilding = "" }
);
URL localhost/Ajax/FindRooms/SOMEBUILDING を参照するとします。SOMEBUILDING が FindRooms メソッドの selectedBuilding パラメータに渡されません。いつもヌル?? POST と GET の両方で機能するようにするには、どうすれば修正できますか?