AJAX and facebook iFrame

Jul 1, 2007 at 4:43 PM
Starting a discussion about AJAX in facebook applications... can anyone comment on whether or not ASP.Net AJAX extensions will work in facebook iFRAME canvas? I think the answer is no but I have read some things that indicate it might be possible in the future.

I thought the discussion bout Silverlight in the v1.2 documentation was helpful... I would love to read something similar for AJAX.
Jul 1, 2007 at 8:33 PM
So... just to confirm my original post... I created a simple AJAX page which works as expected running in the browser, but when I run it in a facebook iFrame the partial page updates no longer work.

So is facebook's so-called "mock AJAX" in FBML the only way to get this sort of bevavior in a facebook application?
Jul 1, 2007 at 11:30 PM
Why would the extensions not work? I was looking foward to using them in my application within the next few days.
I don't see a reason as to why it wouldn't work.

Has anyone else tried it?
Jul 2, 2007 at 2:37 PM
Hmmm. I also expected that to work.

I will try to get to it today to see if I can learn anything. I will post back here.
Jul 2, 2007 at 4:44 PM
Thanks. To clarify my message... the page I created will still run, but the AJAX functionality (UpdatePanel in this case) appears to have no effect. That is, instead of just updating the panel the entire page gets refreshed.

The exact same aspx page, running in the browser, works as expected.

The page I tested was very similar to the simple page in Joe's Stagner's intro video here:

Run that in a facebook iframe and I think you will see what I mean.

Jul 2, 2007 at 10:05 PM
I just tried a very simple AJAX example in my IFrame sample application. And the Update Panel worked fine.

I just posted my updated IFrame base page (which could have been your problem), and included my ajaxSample.aspx in planned Release v1.2.

I plan to add a couple more compelling examples. But, from what I can see, ajax will work fine on the hosted iframe canvas.
Jul 3, 2007 at 2:46 AM
Thanks... that's good news but very strange... I just downloaded change set 7465 and I am having the same problem. My ajax page is using a master page, but other than than I don't see a lot of differences from your sample. I'll do some more testing and if I find the problem I will post back here.

Jul 3, 2007 at 4:32 AM
In looking more closely at the web.config file in your sample app I see that I have a reference to System.Web.Extensions Version=1.0.61025.0 whereas you have Version=

Not sure why that is... I thought I had the latest shipping version of everything. Are you running Orcas? If so maybe that is the difference.

Jul 3, 2007 at 5:18 AM
OK my new working theory is that the sample app was built using Orcas and .Net Framework 3.5 (whereas I am using shipping stuff). This forum on asp.net discusses this issue.


Can you confirm that this is the case? If not I am really stumped... I pulled your ajax smaple page into my project, and it works just fine until I run it in a facebook iframe. Everything appears to be the same except for the System.Web.Extension version numbers in web.config.

So I think this is fixed in Orcas... can anyone confirm or deny that?
Jul 3, 2007 at 2:50 PM
Nope. I didn't use orcas. I will test some more today.

Did you try my sample at apps.facebook.com/aspnetcanvasiframe?
Jul 3, 2007 at 3:21 PM
OK, no Orcas. Have you installed .Net Framework 3.5?

I did try the sample at apps.facebook.com/aspnetcanvasiframe and I can see that you got it working.

What I know for sure (from looking at your web.config) is that you are using a newer version of System.Web.Extensions.dll (installed by default in C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions). I just don't know where it came from because I am running RTM of the AJAX extensions.

There is a good whitepaper at http://ajax.asp.net/documentation/AspNet_AJAX_CTP_to_RTM_Whitepaper.aspx that talks about removing the iFrame executor class in the RTM verison of the AJAX extensions. So I wonder if that is my problem.
Jul 3, 2007 at 3:42 PM
I do have Orcas and Framework 3.5 installed locally.

But, I am not sure that is the reason why I got it to work. But, I did uninstall and re-download the asp.net ajax extensions yesterday. The System.Web.Extensions that I am referencing was installed by that install (in C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025).

Jul 3, 2007 at 4:00 PM
But the web.config in your sample references System.Web.Extensions v2.0.0.0. Are you sure you don't have both versions on your machine?
Jul 3, 2007 at 4:22 PM
I see the one reference to v2.0.0.0 in the ConfigSections. I just changed it to the 1.0.6... version (to match the other references that I had in the web.config). And it did not seem to impact it.

My machine and webserver both have framework 3.5 installed. If you want to email me your sample, I can try to put it on my webserver and we can try it out if you want.
Jul 3, 2007 at 5:34 PM
OK... I installed .Net Framework 3.5, updated the reference to use the new System.Web.Extensions.DLL (installed by defaults at C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5) and everything now appears to work properly. At last!

I think if you will check your web.config file in the sample you will find more references to System.Web.Extensions in the <httpHandlers> section in the lines that beging with "<add verb..." and in the <httpModules> section.

Thanks for all the help - it seems .Net Framework 3.5 was the answer.

Jul 3, 2007 at 6:19 PM
Cool. Glad it worked.

I'd still like to figure out what the deal is. I just went through my entire web.config and changed all System.Web.Extensions.dll references to the old version. And redeployed. (Hoping it would break) But, it didn't.

I definitely don't have any web.config references to the new one anymore.

Can you try that on your side and see if you get the same behavior now that you have the 3.5 framework.

BTW- Are you using my latest IFrame Base page?
Jul 3, 2007 at 8:07 PM
I have tested this using your IFrame base page from change set 7465 and with your AjaxSample.aspx page (which I copied into my project). Got the same results until I installed .Net Framework 3.5, after which both pages started working as expected.

But you are correct the web.config file seems to have nothing to do with it - I changed everything back to v1.0.61025 and it now seems to work fine. Hmm.

I am now thinking it's something on the server side... maybe the web server has to have .Net Framework 3.5 installed? I say that because while the app now works fine on localhost (where I now have .Net Framework 3.5 installed) it no longer works with my hoster. When I run from my hoster I now get some exception I have not had time to diagnose.

Does your callback URL for the sample app point to a server with .Net Framework 3.5 installed?
Jul 3, 2007 at 8:21 PM
Yes, my development laptop and my webserver has framework 3.5 (we run some silverlight stuff on our public website, so we have that).

This is very interesting. I am going to add a note to the doc for now indicating that framework 3.5 needs to be installed on the host. I will try it on a different webserver as well to confirm.

Thanks for the help.
Jul 5, 2007 at 6:34 PM
I just reproduced your behavior by posting on my web hosting site.

Seems that Framework 3.5 installed is the solution. I will add it to the doc.

Oct 18, 2007 at 2:16 AM
Does anyone know if upgrading to .net 3.5 will fix the Access Denied problem in IE with cross domain AJAX? the toolkit controls don't seem to work when developing in an iframe.
Feb 11, 2008 at 1:41 AM
.net 3.5 is needed to stop the Access Denied problem in IE.
I found this out after much research a couple of months ago, i'm sorry i did not see this thread earlier.
There are a few webpages about this, there are some mods that you can do to .net 2.0 but they were a bit to much for me...

hope this helps , sorry for delay
Feb 11, 2008 at 7:57 AM
I still need help with this. I upgraded to .net framework 3.5, but I'm still using Visual Studio 2005.

Even though I've upgraded the framework, I still get the same results: Access Denied.

What do I need to change in my website project, in order to fix this?

Feb 13, 2008 at 1:00 AM

I have been using the AJAX in my application for 2 months. (just launched)

this is what you need for that http://weblogs.asp.net/bleroy/archive/2007/01/31/how-to-work-around-the-quot-access-denied-quot-cross-domain-frame-issue-in-asp-net-ajax-1-0.aspx

forget about the 3.5 framework.

By the way, my application is here www.parcelpoke.com or http://www.facebook.com/apps/application.php?id=7827545237