First of all, let me just say that you guys are amazing. I found a lot of help on stackoverflow. So keep the good job.
Ok, here comes my problem. I'm trying to write an app for facebook (just trying for now =)). And I need a little help with JSON.
So here is a part of my HomeController.cs, nothing special really.
dynamic me2 = app2.Api("/me/feed");
ViewData["data"] = me2.data;
Here is my profile.aspx. Its working perfectly and it writes out all the posts on my facebook wall.
<% foreach (JsonObject item2 in (ViewData["data"] as Facebook.JsonArray))
{ %>
<li>
<%=item2["message"] %>
</li>
<%} %>
Ok so now, its time for problem.
"data": [
{
"id": "100001721189066_164115910298999",
"from": {
"name": "Poiskus Nulaena",
"id": "100001721189066"
},
"message": "bleble",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100001721189066/posts/164115910298999"
},
So because of the ViewData["data"] = me2.data; in .cs file the .aspx file returns message (bleble in this example). But how can I access the "link" or "name" element in "actions" array. I tried:
-ViewData["actions"] = me2.actions; ->doesn't work
-ViewData ["actions"] = me2.data.actions; -> not working either
-nested foreach doesn't work in my case
Any help would be useful :P
Thank you
Sebastian