2011-03-22 3 views
0

누군가가 새로운 v5 facebook-C# -sdk로 페이스 북 iframe 캔버스 페이지 크기의 크기를 조정하는 방법을 알려주시겠습니까? 나는 구글에서 몇 가지 솔루션을 시도했지만 올바른 FB 메서드 또는 페이 스북 C# sdk 메서드를 호출하지 않을 것이라고 생각합니다.캔버스 페이지 크기 페이스 북 -C# -sdk

페이지의 나머지 부분이 올바른 외부 페이 스 북을로드하더라도 내 iframe이 잘 렸습니다.

이 코드는 로컬 호스트와 FB 스크롤 막대를 사용하지만 FB 스크롤 막대를 사용하면 캔버스가 항상 잘립니다. 심지어 2010 롤업 설정을 사용하지 않으려했습니다. 도와주세요.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ddd.aspx.cs" Inherits="CN.Project.WebUI.ddd" %> 

body {overflow: hidden;} 

<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> 

<br/> 
<h3>My test header</h3> 
<br/> 
<p> 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. 
Welcome this is a test of a really long page for a facebook app. (last) 
</p> 

</form> 






using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Text; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Facebook; 
using Facebook.Web; 
using System.Configuration; 

namespace CN.Project.WebUI { 
public partial class ddd : System.Web.UI.Page { 
protected void Page_Load(object sender, EventArgs e) { RegisterScripts(); } 

public void RegisterScripts() 
{ 
    var settings = ConfigurationManager.GetSection("facebookSettings"); 
    var current = settings as IFacebookApplication; 

    String csname = "FBInit"; 
    Type cstype = this.GetType(); 
    ClientScriptManager cs = Page.ClientScript; 
    StringBuilder strCmd; 
    strCmd = new StringBuilder(); 
    strCmd.Append("$(document).ready(function() { FB.init({ appId: '" + current.AppId + "', status: true, cookie: true, xfbml: true }); });\r\n"); 
    strCmd.Append("window.fbAsyncInit = function() {FB.Canvas.setAutoResize()};\r\n"); 
    if (!cs.IsStartupScriptRegistered(cstype, csname)) 
    { 
     cs.RegisterStartupScript(cstype, csname, strCmd.ToString(), true); 
    } 

} 
} 
} 

답변

0

캔버스 크기 조정은 Facebook C# sdk와 관련이 없습니다. //developers.facebook : 당신은 아마이 FB.Canvas.setAutoResize

+0

를 참조해야

아직도 나던 작업 위의 코드는 – Craig

+0

당신이 자바 스크립트 SDK를 초기화하고 HTML [FB.init] (HTTP로

+0

감사합니다. 지금 사용 중입니다. – Craig

관련 문제