Can somebody provide a working example of JavaScriptResult in asp.net mvc. I understand that it returns javascript which is then executed on the client side and also that th
Check out my reply in this post;
MVC how to return instruction to run javascipt method?
That will return a partial view to the page. If you want to itterate through a json object then return a json object from your controller and use something like the following;
var obj = eval('(' + msg + ')');
msg above is the returned object from your controller;
then,
$.each(obj.Objects, function() { do something with object });
"Objects" above is a property within the returned json object.
So in c#
public class JsonObject()
{
List Objects{get;set;}
}
Return the above object to the view.
Does this make sense or would you like a working sample?