json - Returning ViewBag as JSONResult result in null data?? wtf? -



json - Returning ViewBag as JSONResult result in null data?? wtf? -

what missing? trying following:

public jsonresult loggedon() { viewbag.firstname = "todd"; viewbag.lastname = "billings" viewbag.email = "me@rad.com"; homecoming json(viewbag, jsonrequestbehavior.allowget); }

the result in js making phone call null/empty? there no built in conversion of viewbag json result? missing? if other object converts json.

viewbag expandoobject such there's nil json converter reflect against. best bet here create anonymous object rather rely on viewbag

here's illustration found on stackoverflow: can serialize expandoobject in .net 4?

json asp.net-mvc-3

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -