InterviewSolution
Saved Bookmarks
| 1. |
How To Return The Json From Action Method In Mvc? |
|
Answer» Below is the code snippet to RETURN string from ACTION method: public ActionResult TestAction() { return JSON(NEW { prop1 = “Test1”, PROP2 = “TEST2” }); } Below is the code snippet to return string from action method: public ActionResult TestAction() { return JSON(new { prop1 = “Test1”, prop2 = “Test2” }); } |
|