Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With this code it should work but you won't have your user id.</p> <pre><code>FacebookApp app = new FacebookApp(); dynamic result = app.Api("me/videos"); return View(result.data); </code></pre> <p>If you really want it you can still create a ViewModel object to store the user id and the videos.</p> <pre><code>public class VideosViewModel{ public dynamic userId {get;set;} public dynamic videos {get;set;} } </code></pre> <p>Code in your action: </p> <pre><code>FacebookApp app = new FacebookApp(); var VideosViewModel vvm = new VideosViewModel(); dynamic result = app.Api("me/videos"); vvm.videos = result.data; dynamic parameters = new ExpandoObject(); parameters.fields = "id"; dynamic result = app.Api("me", parameters); vvm.userId = app.Api("me"); return View(vvm); </code></pre> <p>In your view use Model.videos</p> <pre><code>&lt;%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;dynamic&gt;" %&gt; &lt;% foreach (var video in Model.videos) { %&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>You can also find interresting example here:</p> <p><a href="http://www.facebook.com/notes/nathan-totten/dynamic-objects-and-the-facebook-c-sdk/158611014180033" rel="nofollow">http://www.facebook.com/notes/nathan-totten/dynamic-objects-and-the-facebook-c-sdk/158611014180033</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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