jquery - Asp.net mvc 4: $.Get() method call doesn't hit the action inside the controller -
here's jquery code:
var url = "@url.action("admin", "editmovie")" + "/" + id; $.get(url, function (data) { alert("data loaded: "); });
and method inside controller
public actionresult editmovie(int id) { return partialview("basicmovieinfo", repository.getmoviebyid(id)); }
i placed break point inside editmovie action, not being hit. there reason that?
you have got parameters in reverse. see urlhelper.action
. first parameter action name , second controller name. assuming controller named admincontroller
, should :
var url = "@url.action("editmovie", "admin")" + "/" + id;
Comments
Post a Comment