Steve Trefethen
Contact me
About Me View my LinkedIn profile

Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
Need consulting?
Need Consulting?

Spread Thunderbird

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

TestComplete Keyword Testing Online Training

I will be presenting a three day webinar April 12-14th 2010 from 9am-1pm PST on AutomatedQA's TestComplete. The cost is $499/person and you can register on Falafel Software's website here. For detailed information on this training click here.

Adding XFBML support to the Facebook Starter Kit

November 11 2008 5:59PM

I’ve been playing around with XFBML support for Facebook and thinking about how to incorporate support for it into the Starter Kit. I haven’t decided yet if it should be added directly to the existing master page or add another master page or some other approach. If you feel strongly either way please let me know.

If you would like to add support for XFBML simply replace existing site.master with the following:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="FacebookApp.Site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 
<head runat="server">
    <title>Untitled Page</title>
    <!-- Load Javascript for Facebook Connect -->
    <script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
</head>
<body>
  <form id="form1" runat="server">
  <div>
      <asp:contentplaceholder id="MainContentPlaceHolder" runat="server"></asp:contentplaceholder>
  </div>
  </form>
  <script type="text/javascript">FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init('<%=ConfigurationSettings.AppSettings["APIKey"] %>', "xd_receiver.htm"); });</script>
</body>
</html>

Add an HTML file called xd_receiver.htm to the root of your project with this content:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cross-Domain Receiver Page</title>
</head>
<body>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js" type="text/javascript"></script> 
</body>
</html>

Once you’ve made these changes you can start using XFBML tags. Here’s an example of the <fb:user-status /> added to the Default.aspx page:

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="Server">
  <h1>ASP.NET Starter Kit Application</h1> 
  <fb:user-status uid="<%=Master.API.uid%>" /><br />
...
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Tags:

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Spam filtering provided by: Spam Counter
330 comments approved, 1448 spam caught since October 28, 2009
Powered by Commentor