How do I know what parameter to create when passing a javascript object.
Please consider
var all = [];
//loop through each instrument
for (var i = 0; i < 3; i++) {
var txt = getThis(i);//int
var detail =getThat(i);//string
all.push({
'this': txt,
'that': detail
});
}
ajaxCall.getNow("myUrl", {
all
};
Where ajaxCall.getNow
simply calls the typical $ajax with get
.
The question is what parameter do I need in my MVC controller.
If I use object
then it works but I'm not sure what I need to do to work with the object. As an object, it's fairly useless.
If I try tuple<in, string>
it doesn't work
EG
public JsonResult MyFunction(Tuple<int,string,string,double,double,string,int> all)//this fails
public JsonResult MyFunction(object all)//this works but I only have an ojbect, I@d like to have something like the tuple to work with
So how do I know what type of parameter to set in my MVC controller?