CanvasFBMLBasePage project

Nov 13, 2007 at 4:02 AM
Edited Nov 13, 2007 at 5:28 PM
hi all,

i am trying to create FBML base application.

my code has no error when i compile.
when i run the application in debug mode, nothing happen after base.PageLoad(sender, e); and i get blank page. when i look at sorce of the blank page i got <fb:redirect url=""/>.
is there something i have to do on page load.
the application is not even going to if (!IsPostBack).
i have copy code from AspNetPlatformSample\FBML still not working. i don't know what i am missing here.

please help me.


below is the code for my default.aspx page.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="_default" %>

<form id="form1">
<asp:Label ID="lblDashboard" runat="server"></asp:Label>
<asp:Label ID="lblHelloWorld" runat="server"></asp:Label><br />
<a href="">Default 2 Link</a>
<input type="submit" value="default 2 submit" />

below code is for default.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.ObjectModel;
using Facebook;
using Facebook.WebControls;

public partial class _default : CanvasFBMLBasePage
//Facebook.Components.FacebookService _fbService = new Facebook.Components.FacebookService();

private const string FACEBOOKAPIKEY = "xxxxxxxx";
private const string FACEBOOK_SECRET = "xxxxxxxx";

new protected void Page_Load(object sender, EventArgs e)
base.Secret = FACEBOOK_SECRET;
base.Page_Load(sender, e);

if (!IsPostBack)
// Use the FacebookService Component to populate Friends
Facebook.Entity.User u = this.FBService.GetUserInfo();
Collection<Facebook.Entity.User> f = this.FBService.GetFriends();

string s = "";
if (f.Count != 1)
s = "s";
lblHelloWorld.Text = "Hello " + u.Name + " you have " + f.Count + " friend" + s + "..." + this.FBService.SessionKey;
//this.FBService.SetFBML("Hello " + u.Name + " you have " + f.Count + " friend" + s);
lblDashboard.Text = "<fb:dashboard><fb:action href=\"\">Go to invites</fb:action></fb:dashboard><br/>";
catch (Exception)
Nov 13, 2007 at 6:54 PM
sorry guys, i think i know what i have to do. i will try it today. thanks
Dec 10, 2007 at 11:33 AM
Hi all,

I am facing the same problem as mentioned above.

I am using Iframe to load the pages.

I think the session value is getting expired when redirecting the pages from default.aspx to default2.aspx.

How to store the session key and userid values for fbservice instance.

please help me.

Thanks in advance,

Dec 11, 2007 at 12:08 PM
Can anyone please post a simple and working Hello-World example (aspx and complete code behind cs.aspx) for a CanvasFBMLBasePage?

This would be of great help...

Dec 20, 2007 at 5:02 PM
Edited Dec 20, 2007 at 5:14 PM

a working Hello-World example for a CanvasFBMLBasePage
Well, here it is: