0

当我点击“分享”时,它会在新标签页中打开 Facebook 分享页面。我想在此页面的左侧栏中显示 temp.jpg。这个怎么做?

测试.aspx

<div id="page-wrap">
<!-- AnythingSlider #1 -->
<ul id="slider1" style="width: 778px; height: 452px; background:#fff;">
    <li>
        <div style="float: left; padding-right: 35px; padding-left:50px;">
            <img src="../../img/temp.jpg" style="width: 264px;
                height: 377px; border: none;" />      
            <uc:DownloadControl ID="DownloadControl1" runat="server" PageParameters="1" />
        </div>                
    </li>
    <li>
    <uc:DownloadControl ID="DownloadControl2" runat="server" PageParameters="2" />

...

下载控件.ascx

<div style="float: left">
<a class="icerik" id="facebookShare" runat="server" target="_blank">
<img border="0" src="images/facebook.jpg" alt="Resorts"
    title="Hotels & Resortss" /> Share </a>

下载Control.ascx.cs

protected void Page_Load(object sender, EventArgs e)
 {    
 facebookShare.HRef = "http://www.facebook.com/sharer.php?u=http://www.test.com/test.aspx";
 }
4

1 回答 1

0

如果您想在与sharer.php共享时添加有关您的页面的自定义信息,则必须在页面头部放置额外的开放图形元标记。对于此示例,test.com/test.aspx 包含以下标签:

<head>
<meta property="og:title" content="Test" />
<meta property="og:url" content="http://www.test.com/test.aspx" />
<meta property="og:image" content="http://www.test.com/img/temp.jpg" />
// other meta tags
</head>

有关 Open Graph 协议的更多信息在这里

于 2012-10-19T13:56:17.720 回答