0

I have a fb-like button on top of a Masterpage and wrapped a updatepanel around the Contentplaceholder.

The updatepanel is function, but the fb button reload every time. Anyone know how to prevent this?

4

1 回答 1

0

代码: 。.

<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/nb_NO/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);

}(文档,'脚本','facebook-jssdk'));

<div class="fb-like" style="float: right; vertical-align: top; padding-top: 20px; padding-right: 20px;" data-href="http://www.xxxxxx.com" data-send="false" data-layout="button_count" data-width="150" data-show-faces="true" data-font="verdana" data-action="recommend"></div>

. .

<asp:Panel ID="pnlMainContent" runat="server" Style="margin-top: 5px;" Height="450px" ScrollBars="Auto">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
                                <ContentTemplate>
                                    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                                    </asp:ContentPlaceHolder>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </asp:Panel>

contentpages 功能与更新面板一起使用,但类似 ​​fb 的按钮会在每次部分更新时闪烁

于 2013-05-07T03:30:10.917 回答