To render Json into an MVC view, you will need to use System.Web.Script.Serialization.JavaScriptSerializer which MVC uses internally when you call JsonResult.
window object:
Then in our views we can then render a specific object that was passed to it from the controller: Then in our Javascript, we can then refer to the object using the
window[object-name] property:
0 comments:
Post a Comment