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

.net - Transaction locking an Insert statement -

clojure - Best way to lazily collapse multiple contiguous items of a sequence into a single item -

remove Repeat values from a list in haskell -