.Net controls in iFrame App

Nov 7, 2008 at 8:32 PM
Everything looks great in the sample apps, but I'm trying to use .Net controls on my pages and I'm not having much success.
For instance, when I try to add a asp:button to the IFrameCanvasSample, I get just cutoff text on the screen like:

Go" Text="Go" runat="server" />

Any suggestions or ideas about using .Net controls on these iframe pages?

Nov 7, 2008 at 9:58 PM
Could you post some of the code from your page around where the button code is? My first guess would be that it's some sort of odd syntax issue where it's not reading your asp:button element, but it's hard to say without seeing the code. Feel free to filter out any code you wouldn't want to show to the general public for any reason.
Nov 7, 2008 at 11:21 PM
Sure- thanks. The

here's the aspx page- it's just like one in the sample app (which works), I just added the button:

<%@ Page Language="C#"  AutoEventWireup="true" MasterPageFile="~/IFrameMaster.Master" CodeFile="Default.aspx.cs" Inherits="IFrameSample.Default" %>

<%@ Register Assembly="facebook.web" Namespace="facebook.web" TagPrefix="cc1" %>
<%@ MasterType VirtualPath="~/IFrameMaster.Master" %>
<asp:Content runat="server" ID="content" ContentPlaceHolderID="body">
    <cc1:UserProfile ID="UserProfile1" runat="server" />
    <cc1:PhotoAlbum ID="PhotoAlbum1" runat="server" />
    <cc1:FriendList ID="FriendList1" runat="server" />
    <asp:Button ID="btnGo" Text="Go" runat="server" />

I'm getting this error now:
Control 'ctl00_body_btnGo' of type 'Button' must be placed inside a form tag with runat=server.

It seems that using the iframe should allow unlimited flexibility with what's on the aspx page- is that accurate?

Nov 10, 2008 at 2:45 PM
It should be just as flexible (roughly) as any other ASP page, which means there are still limits. In this case, your button needs to be inside a form, like this (this is required on normal ASP pages as well, as I understand it):

<form runat="server"/>
    <asp:Button ID="btnGo" Text="Go" runat="server" />

Nov 10, 2008 at 2:46 PM
Actually, I just realized I may be missing a required attribute or two on the <form> element, but you get the general idea.
Nov 12, 2008 at 1:44 AM
Of course- thanks!  Good work, by the way