5

Actually my question is simple. I think. But unfortunately, Google can't help me this time. I want to return a JSON in my view in this format:

[[0,"Mark Kordon",null,"My HTML - Mark Kordon"],[1,"John Doe",null,"John Doe Markup"]]

How is this possible?

3
  • I think what you want isn't JSON... Commented Aug 23, 2009 at 1:08
  • Looks like I misunderstood the plugin I was using. The format doesn't mean anything. So looks like the correct answer is from Nick Riggs. But still, this would include the properties. Read JSON. Thanks guys. Commented Aug 23, 2009 at 5:10
  • Look at this stackoverflow.com/questions/2370332/… Commented Aug 26, 2013 at 7:30

1 Answer 1

4

Sounds like all you want to do is return your model from the controller as a JsonResult:

public ActionResult Index()
{
    return Json(yourModel);
}
Sign up to request clarification or add additional context in comments.

1 Comment

Didn't have time to test it, but wouldn't it also return the properties names?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.