Reputation: 1093
My idea is simple I want that people who sees new news or event in my page could share that in facebook. I want to do this through a .aspx page.
Is this possible? If so how can I do it?
Upvotes: 0
Views: 695
Reputation: 3213
Here you are for all the major social sites, just add links on your master page, and populate them in its code behind:
gplus.HRef = "https://plusone.google.com/_/+1/confirm?title=" + HttpUtility.UrlEncode(Page.Title) + "&url=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri);
facebook.HRef = "http://www.facebook.com/sharer.php?t=" + HttpUtility.UrlEncode(Page.Title) + "&u=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri);
linkedin.HRef = "http://www.linkedin.com/shareArticle?mini=true&title=" + HttpUtility.UrlEncode(Page.Title) + "&url=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri);
myspace.HRef = "http://www.myspace.com/Modules/PostTo/Pages/?t=" + HttpUtility.UrlEncode(Page.Title) + "&u=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri);
twitter.HRef = "http://twitter.com/share?text=" + HttpUtility.UrlEncode(Page.Title) + "&url=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri);
google plus is for g+1 (plus one) as well...
Upvotes: 1