AJAX method :
$(".GetF").click(function (e) {
e.preventDefault();
$.post('@Url.Action("test1", "flyer")', { "selectedIds": "1"})
.done(function (data) {
alert("Data Loaded: " + data);
});
});
Controller Action :
[HttpPost]
public ActionResult test1(string selectedIds)
{
......
return Json(list, JsonRequestBehavior.AllowGet);
}
Everytime i make this ajax call, it calls following method only
[HttpPost]
public ActionResult Index(FViewModel vm)
{
}
I tried changing method to HTTPGet and ajax call to type='get' which also doesn't work.
I'm not able to identify what exactly is the issue here. Please note, there are no submit button or forms on the page. The element for which click event is written is just normal link.