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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -