Facebook与数据列表中的会话共享


<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>

正在共享页面网址,我添加了Facebook共享按钮每个数据列表项,但我无法将会话放在URL的末尾。如何添加?

例如,我现在的网址 ->/帮助.aspx?建议=9weK24GUykXJUd1GhSwwvw%3d%3d这总是转到具有相同ID的同一页面,而不匹配。

如何将位置 HRF 添加到会话?

如果会话存在,您可以将其添加到模板中 url 的末尾。

<a href="http://www.facebook.com/share.php?u=<url>&session=<%=Session["yourSession"].ToString() %>"

最新更新