0
<asp:DataList ID="dtList" RepeatColumns="1" runat="server" OnItemDataBound="dtList_ItemDataBound">
<ItemTemplate>
..
<div>
<asp:LinkButton runat="server" ID="lblsuggestion" OnClick="lblsuggestion_Click" Text='<%# Eval("Suggestion") %>' />
</div>
<div>
<a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank">
<img src="Images/facebook.png" /></a>
</div>
</ItemTemplate>
</asp:DataList>
<script>
function fbs_click() {
u = location.href;
t = document.title;
d = document.description;
i = document.image;
window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t) + '&d=' + encodeURIComponent(d) + '&i=' + encodeURIComponent(i), 'sharer', 'toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
我分享頁面的URL,我加入Facebook分享按鈕,每一個數據列表項目,但我不能在URL年底建成會話。我如何添加它?Facebook的分享會議在DataList控件項目
例如我現在的網址 - >/help.aspx?Suggestion = 9weK24GUykXJUd1GhSwwvw%3d%3d 這總是會進入同一個頁面並且沒有匹配。
我該如何添加位置href到會話?
我加入此鏈接&會話=%=會話[」 QID 「]。的ToString()」 的onclick =」返回fbs_click()「target =」_ blank「>並嘗試。不工作。比我試圖刪除onclick事件沒有再次工作。我沒有刪除fbs_click,也沒有更改js url,但我認爲我做錯了什麼。因爲Facebook窗口不再打開。 – i91
對不起,我的回答中有一個錯誤,它缺少一個'<'。它應該看起來像這樣:'<%= Session [「yourSession」]。ToString()%>' – VDWWD