我有一个网页需要从其他网站的RSS源,并显示,如RSS阅读器。
我想添加Facebook的喜欢和分享按钮在每饲料。现在我已经做到这一点,但我同意将共享整个页面,而不是单独的。
我已经使用的XmlDataSource和一个DataList显示饲料,我用下面的代码:
<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>
{C}
谢谢