Illegal Tag Body

Sep 19, 2008 at 12:15 PM
Hi,

I have created a sample application with facebook developer toolkit. It is working correctly in IFrame mode. I want to convert it to support FBML but having some problems. Here is my default.aspx file

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<form id="formDataContent" runat="server">
    <fb:name uid="123456789" />
</form>

This configuration gives following error,

Errors while loading page from application

Parse errors:

FBML Error (line 27): illegal tag "body" under "fb:canvas"

There are still a few kinks Facebook and the makers of yaskil-test-app are trying to iron out. We appreciate your patience as we try to fix these issues. Your problem has been logged - if it persists, please come back in a few days. Thanks!

When I remove first line "<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>" of default.aspx file it is working correctly but this time code behind is not executed. I appreciate any sugesstions.
Sep 23, 2008 at 5:27 PM
Edited Sep 23, 2008 at 5:51 PM
If you are using a Response.Redirect that could be the culprit.
 http://msdn.microsoft.com/en-us/library/ms524309.aspx (the MSDN page for Response.Redirect) it states: "An automatic response body containing the redirect URL as a link is generated." Since fbml does not allow <body> tags it throws the error.
I suggest using the following for redirects:
Response.Write("<fb:redirect url=""" & [your url here] & """ />)
Hope that helps.
Note: edited for formatting
Sep 26, 2008 at 9:41 AM
Hi,

I have exactly the same problem in C#.  Here is my default.aspx which works fine if you remove the first line to remove the reference to the default.aspx.cs codefile.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="_Default" %>
<form>
<div>
     <fb:dashboard>
           <fb:action href="#">Link 1</fb:action>
           <fb:action href="#">Link 2</fb:action> 

           <fb:action href="#">Link 3</fb:action>
           <fb:help href="#">Help Me!</fb:help>
        </fb:dashboard>
        </div>
<br />
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
<div>
                 <fb:friend-selector idname="txtSelectedFriend" />
</div>
</form>


Does anyone know how to get around this?

I look forward to any replies.

Thanks,

Chris

Sep 26, 2008 at 10:11 AM
Possibly unrelated, but I ran into issues with facebook complaining I had duplicate form tags on the page, when trying to do postbacks with buttons etc.

If you run into this too, solutions can be found in this thread: http://www.codeplex.com/FacebookToolkit/Thread/View.aspx?ThreadId=34981