Guys, Im calling a JsonResult but the “getJSON” is sending a null parameter to controller.
In JS I have this…
var ID = $("#Id").val();
$.getJSON("/Orders/JSON", ID, function (data) {
....
};
The var ID has a valid value. I don’t know where I’m going wrong.
public JsonResult JSONEnvolvidosPedido(string ped)
{
...
}
What am I missing?
Tks.
If you are sending data to a server, it needs to be in
key=valueform. You’re just sending a value.You should probably do something like this:
The exact name of the key (
idhere) depends on your server-side code’s requirements.