Problems creating an “Add to Profile” button to an IFrame aspx page

Apr 7, 2009 at 4:28 AM
I am currently creating an Facebook application and am having problems creating an "Add to Profile" button to one of my IFrame pages. I am currently using ASP.net, C#, and the Facebook Developer Toolkit version 2. This is what I found on various messageboards:

I need to add this to my aspx file:

<script src="http://static.new.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
    <script type="text/javascript">

        FB_RequireFeatures(["XFBML"],
        function()
        {
            FB.Facebook.init('<api_key>', '/html/xd_receiver.html', null);
            FB.Connect.showAddSectionButton('profile',document.getElementById('profileAddDiv'))
        });   
  </script>

    In the above script replace with api key of your application. Give the correct path for facebook cross domain communication channel file xd_receiver.html. In my case the path is '/html/xd_receiver.html'.

    The second argument to showAddSectionButton() function must be a dom element in your html. So you must add a dom element in your html where you want the button to be displayed as shown below.

<div id="profileAddDiv" > </div>

I also tried looking at this thread: http://www.codeplex.com/FacebookToolkit/Thread/View.aspx?ThreadId=37723

Both do not work...

Any suggestions? Thank you