Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is the correct way to do this after some research I did last night:</p> <p><i>Action</i> should look like this:</p> <p><pre><code> FacebookApp app = new FacebookApp();<br /> dynamic parameters = new ExpandoObject();<br /> parameters.fields = "id,name";<br /> dynamic result = app.Api("me/videos/uploaded", parameters);<br /> return View(result); </code></pre><br /></p> <p><i>View</i> should look like this:</p> <p><pre> &lt;%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<code>&lt;dynamic&gt;</code>" %></p> <code>&lt;% foreach (var video in Model.data) { %&gt; &lt;object width="352" height="221" &gt; &lt;param name="allowfullscreen" value="true" /&gt; &lt;param name="allowscriptaccess" value="always" /&gt; &lt;param name="movie" value="http://www.facebook.com/v/&lt;%: video.id %&gt;" /&gt; &lt;embed src="http://www.facebook.com/v/&lt;%: video.id %&gt;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="352" height="221"&gt;&lt;/embed&gt; &lt;/object&gt; &lt;% } %&gt; </code></pre> <p>The problem was two fold:</p> <p>1) My URI path was incorrect, it should be:<br /></p> <p>dynamic result = app.Api("me/videos/uploaded", parameters);<br /></p> <p>2) When I said that I was getting the videos back in actual fact I was only getting back the user id and an empty data set for the videos. So in reality it boiled down to the fact that my URI was incorrect.</p> <p>3) When outputting the results I should have set the pointer to start at:</p> <p>Model.data rather than Model itself.</p> <p>@MrKow thanks for your feedback and help with this problem the link you provided is invaluable. I've book marked it for future reference :-)</p> <p>Cheers Rob</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload