How to enable social media sharing in a .NET MVC application?

I have an application that allows a user to add a log entry. In the journal entry approach, I want to have Twitter, Facebook, and Google+ badges that will share the entry in each respective service.

What library can I use for this?

+7
source share
4 answers

No need for a library. Each service provides easy-to-use code snippets to include common buttons for their maintenance. Put each piece of code in your view where you want it.

+15
source

If you donโ€™t want to use different JavaScript files to share your content, you can just use this code, itโ€™s fast because you donโ€™t have to wait to download JavaScript files from different sites, you need to download different images that are easily accessible on the Internet.

//facebook share <a href="https://www.facebook.com/sharer/sharer.php? u=@Url.Encode (Request.Url.ToString())& t=@Url.Encode (Title)" target="_blank"> <img src="/images/social-buttons/Facebook.png"> </a> // twitter <a href="https://twitter.com/intent/tweet? url=@Url.Encode (Request.Url.ToString())& text=@Url.Encode (Title)" target="_blank" title="Tweet"> <img src="/images/social-buttons/Twitter.png"> </a> // google <a href="https://plus.google.com/share? url=@Url.Encode (Request.Url.ToString())" target="_blank" title="Share on Google+"> <img src="/images/social-buttons/GooglePlus.png"> </a> 
+1
source

Yes, each service provider provides a code in its own area of โ€‹โ€‹the developer, but you need to separately study and analyze one by one, that's all in one link.

Linkedin Share:

 <script src="//platform.linkedin.com/in.js" type="text/javascript"></script> <script type="IN/Share" data-onsuccess="lnksuccess" data-onerror="error" data-url="<%=strShareUrl %>"></script> **CallBack Function :** <script> function lnksuccess(url) { alert("url = " + url + " shared successfully"); } function lnkerror(url){ alert("something goes wrong in url sharing"); } </script> 

Check this out for more information (link).

Social sharing buttons for facebook, twitter, linkdin in asp.net

0
source

This is the code for sharing on social networks on asp.net

https://www.dropbox.com/s/taeh04xe86cx9nh/SocialShare.rar?file_subpath=%2FSocialShare

0
source

All Articles