string dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" + app_id + "&redirect_uri=" + Server.UrlEncode(my_url) + "&scope=" + permission;
ClientScript.RegisterClientScriptBlock(typeof(Page), "key", "window.open('"+dialog_url+"','_parent','');");
我使用这段代码来弹出许可对话框。当用户点击允许Facebook时,会在弹出窗口中将用户重定向到我的应用程序。我需要将弹出窗口中的代码发送到父窗口,然后在用户点击允许时关闭弹出窗口。
window.opener.document.location.href
而不是window.opener.location.href
。 - cprogcr