How can I send a json string to view as a json object?
Posted
by yapiskan
on Stack Overflow
See other posts from Stack Overflow
or by yapiskan
Published on 2010-06-17T07:20:34Z
Indexed on
2010/06/17
7:23 UTC
Read the original article
Hit count: 269
asp.net-mvc
|JSON
I have a json string in an action of MVC controller. I want to send it to view as a JSON object. How can I solve this?
public JsonResult Json()
{
... some code here ...
string jsonString = "{\"Success\":true, \"Msg\":null}";
return new JsonResult() { Data = jsonString, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
© Stack Overflow or respective owner