CanvasFBMLBasePage project

Nov 13, 2007 at 3:02 AM
Edited Nov 13, 2007 at 4: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="http://www.facebook.com/login.php?apikey=xxxxxxxxx&v=1.0"/>.
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.

thanks,

below is the code for my default.aspx page.

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

<form id="form1">
<div>
<asp:Label ID="lblDashboard" runat="server"></asp:Label>
<asp:Label ID="lblHelloWorld" runat="server"></asp:Label><br />
<a href="http://apps.facebook.com/aspnetcanvasfbml/default2.aspx">Default 2 Link</a>
</div>
<input type="submit" value="default 2 submit" />
</form>

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.Api = FACEBOOKAPIKEY;
base.Secret = FACEBOOK_SECRET;
base.Page_Load(sender, e);

if (!IsPostBack)
{
try
{
// 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=\"http://apps.facebook.com/cricketnews/invite.aspx\">Go to invites</fb:action></fb:dashboard><br/>";
}
catch (Exception)
{
throw;
}
}
}
}
Nov 13, 2007 at 5:54 PM
sorry guys, i think i know what i have to do. i will try it today. thanks
Dec 10, 2007 at 10: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,
vara

Dec 11, 2007 at 11:08 AM
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...

tia,
Tiradentes
Dec 20, 2007 at 4:02 PM
Edited Dec 20, 2007 at 4:14 PM


a working Hello-World example for a CanvasFBMLBasePage
Well, here it is:
http://www.f8dotnet.info/