FMBL in an IFrame

May 13, 2009 at 8:01 AM

Hi,

Please help! this is driving me crazy! I'm sorry I know this has been asked before but I am still having major problems trying to get FBML working inside an IFrame app.  

I have a page (Invite.aspx) which I am calling from the main form (an iframe), but when it runs nothing happens; nothing gets rendered to the screen.  

Am I doing anything wrong here?  My code is:-


<%@ page language="C#" autoeventwireup="true" inherits="Invite, App_Web_zvckwlkh" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" mce_src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript"></script>

<script type="text/javascript">
    FB_RequireFeatures(["XFBML"], function() {
        FB.Facebook.init('<%=ConfigurationSettings.AppSettings["APIKey"] %>', "xd_receiver.htm");
    });
    </script>


<fb:serverfbml>
<script type="text/fbml">
     <fb:fbml>
        <fb:request-form  method="POST" invite="true" type="Application Name" content="You have been invited to the Application Name application . " > 
        <fb:multi-friend-selector showborder="false" actiontext="Invite your friends to use this application." />
        <fb:request-form-submit />
        </fb:request-form>         
     </fb:fbml>
</script>
</fb:serverfbml>


    <script type="text/javascript">
        $(document).ready(function() {
            FB_RequireFeatures(["CanvasUtil"], function() {

                FB.XdComm.Server.init("xd_receiver.htm?v=2");

                var failed;
                try {
                    /*FB.CanvasClient.setSizeToContent();*/
                }
                catch (e) {
                    failed = true;
                    try {
                        FB.CanvasClient.setCanvasHeight("1500px");
                    }
                    catch (e) {

                    }
                }

                if (!failed) {
                    FB.CanvasClient.startTimerToSizeToContent();
                }

            });
        });

        function resizeContent() {
            FB.CanvasClient.setSizeToContent();
            FB.CanvasClient.startTimerToSizeToContent();
        }      
    </script>


    
</body>
</html>


I don't get any error messages just nothing!

HEELLPP!!!!  (thanks!)

May 18, 2009 at 1:07 PM

I'm in the same spot, b**dy anoying. :)

May 18, 2009 at 1:13 PM

I actually figured it out in the end....I had my 'Connect URL' pointing to my homepage whereby it should have just been pointing to my domain (i.e. http://www.yourdomain.com).

Hope this helps.

May 27, 2009 at 9:47 AM

HI,

How come I am getting " serverfbml" is not supported error  when I try to put this?

<fb:serverfbml>
<script type="text/fbml">
     <fb:fbml>
        <fb:request-form  method="POST" invite="true" type="Application Name" content="You have been invited to the Application Name application . " > 
        <fb:multi-friend-selector showborder="false" actiontext="Invite your friends to use this application." />
        <fb:request-form-submit />
        </fb:request-form>         
     </fb:fbml>
</script>
</fb:serverfbml>

 

Is there anything I need to put on the top of my aspx page?

I would appreciate your help.

Thanks!

May 27, 2009 at 9:58 AM

Hi debsky123,

Are you inheriting from CanvasFBMLBasePage in your code-behind?  Also you might want to make sure that your reference to the facebook.dll are all ok.

 

May 27, 2009 at 11:08 AM

thanks for your quick reply.

Nope, I am using this on my Master page

[code]

public partial class FBSite : facebook.web.CanvasIFrameMasterPage

[/code]

and then on my default.aspx

[code]

 public partial class _Default : System.Web.UI.Page

[/code]

My dlls are ok.

I guess the above code is wrong?

May 27, 2009 at 11:48 AM

Not sure, but although I'm using an IFrame app, I have one page (and invitation page) which is not using a master page and inherits from CanvasFBMLBasePage.  Seems to work well.

Sorry I couldn't be much more help!

May 28, 2009 at 5:21 AM

Hi! I'll try your trick. Thanks!