TwitterLinkedInBlog

Tuesday, August 31, 2010

SP2010 - Share Link To Current Page

.aspx:
<asp:HyperLink ID="ShareHyperlink" runat="server" Text="Share" ToolTip="Share" />

function shareLinkInEmail(subject, body) {
var escapedSubject = escapeProperly(subject);
var escapedBody = escapeProperly(body);
window.location='mailto:?subject=' + escapedSubject + '&body=' + escapedBody;
}

c#:
ShareHyperlink.NavigateUrl = "javascript:shareLinkInEmail('Testing', 'Testing' + String.fromCharCode(13) + '" + Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port + Request.RawUrl + "');";

No comments: