UPDATED Nov. 6, 2008: A new release is available here.
I’ve updated my Facebook Starter Kit to version 1.3 of the Facebook Developer Toolkit published by Microsoft available on CodePlex. I also cleaned up the code and moved the Appkey and Secret so their read from web.config.
Btw, I’ve had a few questions in email about how to fetch a friend list which can be done as follows:
if (!IsPostBack)
{
System.Collections.ObjectModel.Collection<User> userinfo = _fbService.GetUserInfo(_fbService.UserId); Label1.Text = "Hi, " + userinfo[0].FirstName;
Image1.ImageUrl = userinfo[0].PictureUrl.ToString();
// Use the FacebookService Component to populate Friends System.Collections.ObjectModel.Collection<User> Friends =
_fbService.GetFriends();
for (int i = 0; i < Friends.Count; i++)
DropDownList1.Items.Add(Friends[i].FirstName.ToString());
}
If you haven’t seen it I’ve also created a starter kit for Nikil Kothari‘s Facebook.NET framework so be sure to take a look a that as well.
Enjoy!
Hi
I would just like to know if you have a sample of inviting friends to your application
thanks
Eddie
Steve, thanks very much for updating the developer toolkit. I’m trying to get this to work using Vista, IIS 7 and VS2008 and encountering an error. Trying to view any page on the site created by the Starter Kit gives HTTP Error 500.19 – Internal Server Error.
Config Error: Cannot add duplicate collection entry
Failing on line 75:
75: <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Do you have any thoughts on what might be causing this and how I can get up and running?
I’ve resolved the issue I mention above by changing the target framework of my site from 2.0 to 3.5.
However, AddApp.aspx and RemoveApp.aspx balk with:
Cannot find ContentPlaceHolder ‘HeaderContentPlaceHolder’ in the master page ‘/AppTestRB/Site.master’, verify content control’s ContentPlaceHolderID attribute in the content page.
… is it possible that your Master Page is missing a few ContentPlaceHolder controls?
Hi Rob,
Thanks very much for the feedback. I’ll double check to make sure these aux pages are correct and if not post an update for the Starter Kit.
Same problem as Rob Burke. The Site.Master in this Toolkit is not setup correctly, it has <asp:contentplaceholder id="MainContentPlaceHolder" runat="server"></asp:contentplaceholder> replace this with:
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContentPlaceHolder" Runat="Server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="NavBarContentPlaceHolder" Runat="Server"></asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightColumnContentPlaceHolder" Runat="Server"></asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CenterColumnContentPlaceHolder" Runat="Server"></asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="FooterContentPlaceHolder" Runat="Server"></asp:Content>
I’ve done and now I can publish to my local IIS and run the application from Visual Studi and it correctly links back to my local aspx files, I cannot add the application on facebook. If I run through the add app use case it fails when trying to run Appadd.aspx with a 404 error. Not sure where I’m going wrong.
Regards,
Klaus
Hi Klaus,
Thanks for the follow-up, I needed the reminder. I just now updated the starter kit and fixed the content place holder references. I’ll test the addapp.aspx page to make sure that’s working correctly.
Rob & Klaus,
I see that I made a mistake on the wiki page and didn’t include "MyApp" in the Add/Remove page URL’s. I’ve since corrected that error in the Welcome.htm as well as on the wiki. Apologies.
Hi JR,
I no longer use VS.NET 2005 and won’t be going backwards to update this starter kit. Sorry about that.