How do I create a Facebook Share button using ASP.NET MVC3 - asp.net

I would like to implement a Facebook Share button using ASP.NET MVC3, like following image.
I have installed Microsoft Web Helper in my MVC application, and I am able to create a Facebook Like button using #Facebook.LikeButton();; But how can I create a Facebook Share button?

The Share Button is no longer officially supported by Facebook. However, for now you can still achieve the old Share Button's functionality by using Facebook's "sharer.php" app.
Just apply a link in the following format to your button image or link text:
https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.yourpage.com
In the long run though, your safer solution would be to use one of the still supported social plugins, like the "Like" button or the "Send" button.

The facebook share button isn't available in the facebook helper, only the following social plugins:
Like Button
Activity Feed
Recommendations
Like Box
Login Button
Facepile
Comments
Live Stream
http://facebookhelper.codeplex.com/documentation
By the way the share button is deprecated and will be not supported in the future, because the click through rates of the Like Button are better. More info at the bottom of this page:
https://developers.facebook.com/docs/reference/plugins/like/

Related

How to add "Share" button in html email?

I'm wondering if we can add a share button in emails only with HTML and CSS. If user clicks on button, it would open the popup with different sharing options like whatsapp, email etc.
I think there is no way to make popup in html emails.
JS doesn't work in html emails due to security reasons and hacks like modal based on hidden checkbox should not work either.
If showing popup is critical you can dig into AMP Emails, maybe there is something about modals.
But a bulletproof method is using just plain links for each social. For example sharing via Facebook should look somethink like
Share
You can decorate links with social logo so it would look just like common share button

Custom Google Form? Example of Google Form API?

I'm trying to make a google form look like my own site. I found examples of how to do this on How to style Google Forms and google-custom-form (GitHub project), but I tried both of the examples they give and they seem to fail now.
I had a look at Class Form - Google Apps Script which seems to be like an API, but I can't get my head around the documentation. Does anyone have an example of it working. Or has found another way of getting this to work? It would be really handy to do as embedded forms look really out of sync with the rest of the site.
The API you're linking to is an apps script API. This is needed if you want to create dynamic forms (dynamic amount of questions, dynamic answers,...) but not for custom styling. An intro to appscript can be found on this page: https://developers.google.com/apps-script/
You could just create a form manually on https://www.google.com/forms/about/
You can change the styling and colors in the top-right of the page. When you are ready to embed the form on your own page you have to press "SEND", an select the embed icon <> at the top.
I've worked with this a ton, and still have issues with it. Been learning the new api v4 for sheets but still having trouble, it is still in beta too. For now I can recommend this solution though by heaversm on github.
https://github.com/heaversm/google-custom-form
The example fully works as long as you find the entry.xxxxxxx for each field and replace in the appropriate js. To avoid the embed issues, give your form submit on a click function that has the event as the input and then preventDefault on the event like so:
$('#submit-button').on('click', function(event){
event.preventDefault();
// continue code from heaversm
});
Hope this works for you. Cheers

Resize facebook share button

I would like to resize the facebook share button. The default one provided by facebook is ridiculously small, and I am having difficulty resizing it. I tried overwriting the class, and even adding an ID, but nothing that has achieved desired result.
I mean below is the facebook share button:
<div class="fb-share-button" data-layout="icon"></div>
any help would be greatly appreicated, and please note that it also has to look good on mobile, i just need more flexibility in customization.
The Facebook Share button does not directly allow you to modify the style of the button. However you are able to create your own share button which will allow you to customize this to reflect the feel of your website.
For example for you can utilize the Javascript SDK to spawn a share dialog like so:
FB.ui({
method: 'share',
href: 'https://developers.facebook.com/docs/',
}, function(response){});
You can also use a URL redirect and link this with your custom button.
https://www.facebook.com/dialog/share?app_id=145634995501895&display=popup&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer
Please reference the following documentation for further details on the implementation: https://developers.facebook.com/docs/sharing/reference/share-dialog
However please ensure you adhere to the Facebook Brand Guidelines outlined here https://www.facebookbrand.com/

Problems with Like button

I use for my site www.spazio-psicologia.com facebook plugin to have social integration with facebook platform.
I have one problem: like button seems to work proprely collecting click of who likes my articles, but sometimes, without any reasons, it clears all click collected and restart counting from zero.
How can I fix this problem?
Thanks
Laura
The Best way to put like button in your site:
https://developers.facebook.com/docs/reference/plugins/like/
Just click Get Code, put that in your template. Facebook will do the rest.

How do I login in with facebook connect in a flex application

I've been checking out facebook connect stuff from the new actionscript 3 library from Adobe. I have been trying to figure out how to use the facebook connect button inside of a flex app.
In an html page you would us the fbml and it would automatically put the facebook connect button on your page and when the user clicks on it it pops up the face div and lets the user login. Well you can't use that in flex. So I could put it on the page containing the swf but, that's why I'm using flex and not html. I've seen it done by the guys at Universal Mind so I know it's possible. I just need a little direction.
I know the function to use in the facebook connect api to cause that login dialog to come up I just can't figure the correct combination.
Chcek out the Create your first Facebook application with Flex tutorial and in particular the section on Add Facebook login.
This should be applicable to Flex. This would be done using the ExternalInterface calls from within Flash.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html
In Adobe facebook-actionscript-api there is a class LoginWindow which you can use.
When you need it this window will open like small flash popup window and it will display facebook login page and enable user to login. All needed events will be raised and you should be connected after that. I didn't tested it but from the code looks like what you need.
this developer created this js/flash bridge you are talking about using the ExternalInterface classes. you can download all source files as well. i found it very useful.
http://www.wellconsidered.be/blog/2009/01/04/facebook-connect-to-actionscript-3/
There is also a very clean and elegant solution/tutorial at:
http://www.stevenvh.be/blog/?p=57
Use this API:
http://code.google.com/p/facebook-actionscript-api/
Look at ConnectDemo.
The sample kind of sucks... it forces you to connect before showing the Flex app.
You need to tweek the example to get it to do what you want.
Also, FB depreciated some of the methods, so you have to look up new methods that aren't depreciated.
I'd love to update the sample, but I don't have the time to dedicated to another project.

Resources