Permission popup buttons not visible
I was following the tutorial Getting Started with an ASP.NET MVC 3 Website
using the 5.0.25 (RTW) release.
Everything is fine , except the default display "popup" uses the full width of the screen , so running the app locally is fine , but when i put it on a开发者_StackOverflow中文版 facebook page the buttons are not visible.
public ActionResult LogOn(string returnUrl)
{
var oAuthClient = new FacebookOAuthClient(FacebookApplication.Current);
oAuthClient.RedirectUri = new Uri(redirectUrl);
var loginUri = oAuthClient.GetLoginUrl(new Dictionary<string, object> {
{ "state", returnUrl },
{"response_type", "token"},
{ "display", "popup" },
{ "scope", "offline_access,email" } });
return Redirect(loginUri.AbsoluteUri);
}
(screen shot) http://imageshack.us/photo/my-images/855/fbnobuttons.png/
tried to use iframe , but its not allowed , using display:"page" displays the full facebook page again (page in page). I know i could use the javascript sdk but i need to do it this way.
i would appreciate any help
I think this related to your return Redirect(..)
As you are in an iframe, with this code you are only changing the iframe location, while you should be redirect the WHOLE page ..
Instead of using return redirect you should return an empty html page with this code :
<script type="text/javascript">
top.location.href='%s';
</script>
where %s
is your login.AbsoluteUri
Does this help ?
精彩评论