开发者

Canvas page size facebook-c#-sdk

Could someone please tell me how to resize the facebook iframe canvas page size with the new v5 facebook-c#-sdk? I have tried a few solutions from google however I think I am not calling the correct FB method or facebook c# sdk method.

My iframe is being truncated even though the rest of the page loads correct outside facebook.

I can not go any further, this code works on localhost and with the FB scroll bars on, however with FB scroll bar setting off canvas is always truncated. I have even tried disabling the 2010 rollup setting. Please help.

<%@ 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);
    }

}
}
}


I don't think canvas resizing relates to the facebook c# sdk.

You should probably refer to this FB.Canvas.setAutoResize

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜