ASP.NET

From Facebook Developers Wiki

Jump to: navigation, search

(NOTE: It appears that both the Microsoft toolkit and the Jay Lagorio toolkits were not intended to work inside the canvas. I have been able to get the Microsoft toolkit to work in the Canvas, as described in the Comments section.)

[edit] Solution to an IE gotcha when developing Facebook App in an IFRAME

This was a very frustrating problem for us in our app Jobs (http://apps.facebook.com/getthejob).

The problem was that in IE, if a parent frame has a different domain than the child page, the session data (stored in the Session object) is not preserved as a security precaution.

Anyway, if you have this problem, the answer is available on Microsoft's website.

Simply put, in your ASP.NET page codebehind, add the following code:

   protected override void OnPreRender(EventArgs e)
   {
       Response.AppendHeader("P3P", "CP=\"CAO PSA OUR\"");
       base.OnPreRender(e);
   }

This will add the right headers to every page.


That code is in C#. For the VB version, try this:

 Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
   Response.AppendHeader("P3P", "CP=""CAO PSA OUR""")
   MyBase.OnPreRender(e)
 End Sub
Navigation