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

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -