I have a piece of javascript posting to my controller like this:
var url = '/Account/getCols';
var formData = { colName: colName }
$.post(url, formdata, function (data, textstatus) {
etc...
where Account is the controller getCols is a method within that controller. The method returns a list like so:
public List<string> getCols(string colName)
{
//do some stuff here
List<string> l = new List<string>;
//do some more stuff like adding and other manipulation here
return l;
}
How do I use the list when it is returned within my javascript? or should I use some returned Json? or anything else? Sorry, I am rather new to MVC and still looking APIs etc... Would be grateful for help.