the whole"login to application"page in the iframe

Jan 4, 2008 at 2:51 AM
i am developing an app based on the FacebookWebSample of the C# and i use the iframe, when i send a link like"http://apps.facebook.com/myappname" to a friend who didn't add the app ,then he/she is redirect to a "login to application"page, the question is, the whole facebook site page will appear in the iframe, i can't fix it up.

anyone can help? thanks.
Feb 18, 2008 at 2:12 AM
Ryan,

I was wondering if you found the solution to the problem? I am facing the same problem and cannot come up with a solution.

Amit
Feb 18, 2008 at 5:45 AM
What does your authentication code look like? If you are simply inheriting from the base classes provided by the toolkit, this should never happen.
Feb 18, 2008 at 2:43 PM
Hi Ski

After inheriting from CanvasIFrameBasePage i was able to get rid of the problem. But now i run into another problem and it ask for a password when i try to loads in the application. Also, after entering the password my profiles whole facebook page is showing up in the IFrame. I was wondering if you have any thoughts on that?

Amit
Feb 18, 2008 at 5:01 PM
What do you mean your 'profiles whole facebook page'? Are we talking about your app's FB canvas page or your personal FB profile? Again, if you are doing the inheritance correctly, you shouldn't have any problems with your canvas pages. Are you using the most recent version of the toolkit?
Feb 19, 2008 at 1:11 AM
Edited Feb 19, 2008 at 1:12 AM
ok i may be doing some thing wrong because after rewriting i was able to get rid of the problem i mentioned earlier. But this time i am sure there this is not working:

My Content page keep reloading.

My master page code is:

public partial class FBT_M1 : CanvasIFrameMasterPage
{
private const string FACEBOOKAPIKEY = "XXXX";
private const string FACEBOOK_SECRET = "XXXX";


new protected void Page_Init(object sender, EventArgs e)
{

base.Api = FACEBOOKAPIKEY;
base.Secret = FACEBOOK_SECRET;
base.Page_Init(sender, e);
}

}

and my content pages are Default.aspx and Default2.aspx which are inheriting from the same master page:

the problem occurs when i redirect from the Default.aspx to the Default2.aspx in the page_load event

Code for Default.aspx

public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FacebookService fbService = ((CanvasIFrameMasterPage)this.Master).FBService;
lblUser.Text = fbService.GetUserInfo().Name;
int numGroups = fbService.GetGroups().Count;
lblGroups.Text = "You are in " + numGroups + " group" + (numGroups == 1 ? "" : "s") + ".";
Response.Redirect("Default2.aspx");
}
}

code for Default2.aspx.

public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
The page keeps refreshing after initial login.

I also noticed that if i do Response.Redirect in a postback event like a button click the code works just fine.


I was wondering if you have any thoughts on that.
Feb 19, 2008 at 1:38 PM
Is Default or Default2 the one that keeps reloading after login?
Feb 19, 2008 at 1:50 PM
It is Default2.aspx which keep reloading.
Feb 20, 2008 at 2:32 PM
Hi Ski,

I was wondering if you got the chance to look at the problem.

Amit
Jun 13, 2008 at 12:54 AM
What is it about inheriting from the base page that forces this not to happen?  I'm developing my Facebook app using ASP.NET MVC and I am wondering why I need to inherit from IFramePage to avoid this effect.  Thanks.

skiafnm wrote:
What does your authentication code look like? If you are simply inheriting from the base classes provided by the toolkit, this should never happen.



Jun 13, 2008 at 9:57 AM
I had same problem a long time ago but i remember it was something wrong with my facebook app settings, like post add url or something
Jun 13, 2008 at 5:44 PM
Nevermind.  It has to do with the little script that gets written in the redirecttopframe.... Thanks.
Jun 20, 2008 at 3:13 PM
Dear Mike. I have this problem myself. What exactly do you mean with the redirecttopframe?
Jun 20, 2008 at 3:14 PM
Dear Mike. I have this problem myself. What exactly do you mean with the redirecttopframe?

MikeBosch wrote:
Nevermind.  It has to do with the little script that gets written in the redirecttopframe.... Thanks.


Jun 26, 2008 at 4:16 PM


RyanLeo wrote:
i am developing an app based on the FacebookWebSample of the C# and i use the iframe, when i send a link like"http://apps.facebook.com/myappname" to a friend who didn't add the app ,then he/she is redirect to a "login to application"page, the question is, the whole facebook site page will appear in the iframe, i can't fix it up.

anyone can help? thanks.



Ryan, you should not sent this link to your friends but rather the facebook about us page of your application.

each application has such a page. Example, this is how you ENTER my application as a user http://apps.facebook.com/realmofempires/ 

and this is its about page http://www.facebook.com/apps/application.php?id=10471770557