Illegal Tag Body

Sep 19, 2008 at 11:15 AM

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" />

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 4:27 PM
Edited Sep 23, 2008 at 4:51 PM
If you are using a Response.Redirect that could be the culprit. (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 8:41 AM

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" %>
           <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>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                 <fb:friend-selector idname="txtSelectedFriend" />

Does anyone know how to get around this?

I look forward to any replies.



Sep 26, 2008 at 9: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: