开发者

How to navigate to different Silverlight Control in Facebook Canvas ASP.NET MVC Application

开发者 https://www.devze.com 2023-01-15 04:52 出处:网络
In my Facebook Canvas application i have the following problem: The Facebook application is runnin开发者_JS百科g in an iframe inside Facebook.

In my Facebook Canvas application i have the following problem:

The Facebook application is runnin开发者_JS百科g in an iframe inside Facebook.

Basically it is an ASP.NET MVC application with two different silverlight apps nested in two different Views(and different controlls)

If the user is in one silveright control the user should be able to navigate to the other silverlight control and exit the old silverlight control. (all of that should happen in the facebook canvas application)

Until now i tried it with:

HtmlPage.Window.Navigate(new Uri("http://apps.facebook.com/appname/Game/Index?opponentId=" + opponentId));

It somehow tries to navigate but not correctly. I just see a link and the facebook logo inside the iframe. When i click the link it navigates correctly.

You can see the result here: http://hospero.de/facebook.jpg

How could i correctly navigate to the new silverlight control inside the facebook iframe?

Thanks in advance

EDIT:

Now navigating to the page containing the new Silverlight control works.

But somehow it can't download it. That's strange because the same Control works when testing seperatly.

I get the following error:

Unhandled Error in Silverlight Application  Code: 2104

I investigated what that error could be and most of the time it had something to do with MIME types.

But how can that be if my first control gets loaded perfectly?


You are using the app url when you need to use the local url. So navigate to:

http://YOURDOMAIN.com/Game/Index?opponentId=" + opponentId

and not

http://apps.facebook.com/appname/Game/Index?opponentId=" + opponentId

because otherwise you are loading Facebook again within the iFrame as you are seeing

0

精彩评论

暂无评论...
验证码 换一张
取 消