在ASP.NET中DataList的每个元素下提供facebook共享按钮 [英] provide the facebook share button under each element of a DataList in ASP.NET

查看:49
本文介绍了在ASP.NET中DataList的每个元素下提供facebook共享按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,该网页可以接收其他网站的RSS提要并进行显示,例如RSS阅读器.
我想在每个提要的末尾添加Facebook喜欢和共享"按钮.现在,我已经做到了,但是当我共享整个页面时,不是< item>分别.

我使用了XMLDataSource和DATAList来显示提要,并且使用了以下代码:

I have a webpage which takes the RSS feed from other websites and show them, like RSS reader.
I want to add Facebook like and Share buttons at the end of every feed. Now I have done that but when I share the whole page will be shared, not the <item> separately.

I have used an XMLDataSource and a DATAList to show the feeds and I used the following code:

<asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
    <itemtemplate>
    <%#XPath("title")%>
    <hr color="#0099ff" /> 
        
        <br />
    <%#XPath("description")%> 
        
        <fb:like xmlns:fb="#unknown">
            href="http://www.sportlog.nl"
            send="true"
            action="recommend"
            layout="standard"
            colorscheme="light"
            show_faces="false"
            width="450">
</fb:like>

        </form>
    <div id="fb-root"></div>
     <pre lang="c#"><script>
         window.fbAsyncInit = function () {
             FB.init({ appId: 'put app id here', status: true, cookie: true,
                 xfbml: true
             });
         };
         (function () {
             var e = document.createElement('script');
             e.type = 'text/javascript';
             e.src = document.location.protocol +
           '//connect.facebook.net/en_US/all.js';
             e.async = true;
             document.getElementById('fb-root').appendChild(e);
         } ());
     </script>







<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
       type="text/javascript">
    </script>

       <br />



谢谢



Thanks

推荐答案

kjkljkk; l jk jkllljkl
kjkljkk;ljkjkllljkl


这篇关于在ASP.NET中DataList的每个元素下提供facebook共享按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆