Social Sharing

Social Sharing Bootstrapped with no external JavaScript

Using just links in Asp.NET Core 2 add @@Context.Request.GetDisplayUrl() to get the url of the page your sharing.

First download Mofit.Social and install it. Open your site folders Modules/Mofit.Social/Views/Parts/Social.cshtml and delee everything in the file. and Add the below changing it to your own website content.

We will be using Font Awesome Icons for social icons on our bootstrap buttons but you could easily use glyph-icons or your own images instead and all the links open in a browser friendly window, thus no user gets lost  from your website on a new browser window, tab or page.

Not a download of JavaScript or Cookies is required.

As this is an issue? Probably not on your nice high-speed broadband, but is it an issue on your phone.

Of course this technique does have some downsides, the first is that you don’t have access to things like share counts and features like Facebook showing you if your friends have liked an article.

And some other issues like not being able to track clicks onto them are easily mitigated with some JavaScript feeding into your analytics package.

There is also an added bonus in that you don’t need to have Facebook/Twitter/Etc cookies coming from your website.

How to do this

Add the links below. Changing to Your Titles, Summary and where needed a Description.

Url’s Model is buy url=@Model.Url on each link  and by addingdata-url=”@Model.Url” so the page your user is on gets shared, instead of your website home url.

    <div class="postnewtweet pull-left">
        <div class="btn-group" role="group">
        <a class="btn btn-info btn-sm" data-toggle="tooltip" data-url="@@Model.Url"
        href=" Don"
                data-original-title="Post A New Tweet" data-user-id="105217183">
        <button type="button" class="btn btn-info btn-sm newtweet"></button>Tweet</a>
    <div class="divgplusshare pull-right">
        <div class="btn-group" role="group">
        <a class="btn btn-danger btn-sm" data-toggle="tooltip" data-url="@@Model.Url"
        onclick=", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" data-original-title="Share on Google+">


 <button type="button" class="btn btn-danger btn-sm gplusshare"></button></a>

The Container div

        <div id="socialcontainer" class="center">
        <div class="row">
        <span class="btn-group">
        <a class="iframe btn btn-sm btn-default" data-toggle="tooltip" data-url="@@Model.Url"
        data-count="horizontal" title="" href="" data-original-title="Don Boulton Blog RSS">
        <i class="fa fa-rss"></i>
        <a class="btn btn-sm btn-default" data-toggle="tooltip" data-toggle="tooltip"
        data-original-title="Email Donald Boulton at Google + Page" href="" onclick=", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
        <svg xmlns="" class="icon fa-envelope" viewBox="0 0 512 512">
            <path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49-16.841 13.247-50.201 45.072-73.413 44.701-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112h416zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646 21.857 17.205 60.134 55.186 103.062 54.955 42.717.231 80.509-37.199 103.053-54.947 49.528-38.783 82.032-64.401 104.947-82.653V400H48z"></path></svg>
        <a class="btn btn-sm btn-default" data-toggle="tooltip" data-count="horizontal"
                       href=" TEXT&via=TWITTER USERNAME"
                       class="twitter-share-button" data-original-title="Twitter Share" data-user-id="TWITTER USER ID">
        <i class="fa fa-twitter"></i>
        <a class="btn btn-sm btn-default" data-toggle="tooltip"
                       data-url="@@Model.Url"  rel="publisher" href=""
        onclick=", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" data-original-title="Share on Google+">
        <i class="fa fa-google-plus"></i>
        <a class="btn btn-sm btn-default" data-toggle="tooltip"
                       data-url="@@Model.Url" href=""
        onclick=", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" data-original-title="Facebook" >
        <i class="fa fa-facebook"></i>
        <a class="btn btn-sm btn-default" data-toggle="tooltip" data-url="@@Model.Url"
                       href=" TITLE%20Website&summary=My%20favorite%20web%20site&source=YOR WEBSITE URL" onclick=", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" data-original-title="LinkedIn">
        <i class="fa fa-linkedin"></i>
        <a class="btn btn-sm btn-default" data-toggle="tooltip"
        data-url="@@Model.Url" href=""
                       onclick=", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" data-original-title="My One Drive">
        <i class="fa fa-windows"></i>
        <a data-toggle="tooltip" data-url="@@Model.Url"
                       data-original-title="Proof of God scientifically" class="youtube btn btn-sm btn-default" href="">
        <i class="fa fa-youtube"></i>
        <input value="donboulton/Sohc" name="uri" type="hidden"> //For Feedburner
        <input value="en_US" name="loc" type="hidden"> //For Feedburner
        <meta content="EN" itemprop="InLanguage"> //For LinkedIn

Attach Mofit.Social Part to Blog Posts and Pages, set positioning with if you need it to be place anywhere but at the bottom of your post or page.

Add the page link to your post or page in the Mofit.Social Url input, add the full URL.

Limited Dependencies With Twitter Web Intents

Some sites may prefer to embed the unobtrusive Web Intents pop-up JavaScript inline or without a dependency to The snippet below will offer the equivalent functionality without the external dependency. Twitter Web Intents page.

        (function() {
        if (window.__twitterIntentHandler) return;
        var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
          windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
          width = 550,
          height = 420,
          winHeight = screen.height,
          winWidth = screen.width;

        function handleIntent(e) {
        e = e || window.event;
        var target = || e.srcElement,
            m, left, top;

        while (target && target.nodeName.toLowerCase() !== 'a') {
          target = target.parentNode;

        if (target && target.nodeName.toLowerCase() === 'a' && target.href) {
          m = target.href.match(intentRegex);
        if (m) {
            left = Math.round((winWidth / 2) - (width / 2));
            top = 0;

        if (winHeight > height) {
              top = Math.round((winHeight / 2) - (height / 2));

  , 'intent', windowOptions + ',width=' + width +
        ',height=' + height + ',left=' + left + ',top=' + top);
            e.returnValue = false;
            e.preventDefault && e.preventDefault();

        if (document.addEventListener) {
        document.addEventListener('click', handleIntent, false);
        } else if (document.attachEvent) {
        document.attachEvent('onclick', handleIntent);
      window.__twitterIntentHandler = true;

Add A Page Review

Add A Rating: 
Please Agree to Our Terms and Conditions  *