Facebook Share Button for ASP.NET

Facebook Share Button is used for sharing interesting content with Facebook friends. It can be anything from news, articles, link to products, YouTube videos, Facebook applications, etc. Sharing content creates link back to website or Facebook application where the content is located. It brings more visitors from links directly, and from increased rating on search engines. Share Button is replaced with Facebook Like Button when Graph API is released. Facebook recommends using Like Button, but Share Button is still used very frequently used on many websites, small ones and professional. It is also very common to find Like Button and Share Button on the same page.

Facebook Like Button ASP.NET control is an easy way to integrate this feature in ASP.NET pages. It can be also configured dynamically from the code behind in C# and VB.NET. Compiled version and source code version of this ASP.NET control are available in C# and VB.NET programming languages, as part of Facebook ASP.NET (C# and VB.NET) Control library.




Picture of the 5 types of buttons:

sharebutton




Facebook Share Button ASP.NET control has a demo page inside Demo Website that shows how it works. The most important fact is that the Demo website is contained in the package with the library, which is very useful resource for code examples, in both C# and VB.NET, for each control from the library. Look at the Facebook Share Button demo



Configuration

Configuration of the Facebook Share Button ASP.NET control is done in ASPX page by setting optional properties. If dynamic setting of properties is required, they can be also set in the code behind, for example on Page_Load method. Following table shows the list of all properties with their types and descriptions.


Properties:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
Type
String
Type of share button. Available values are 'icon', 'icon_link', 'button', 'button_count', and 'box_count'. Default value is 'icon_link'.
facebook login button asp.net
Title
String
Title of Share button. Default value is 'Share'.
facebook login button asp.net
Url
String
Url to share. Default value is URL of page where the control is placed.




Usage Examples:

Following examples show registration and insertion of Facebook Share Button ASP.NET control in ASPX file. There is an example of creating 5 types of share buttons from picture above. For each type, different properties are set. The first control creates share button of type 'icon', with URL set to page where it is placed. The second one creates default button. The third creates 'button' type, with defined Title property. The 4th creates share button of type 'button_count' with defined URL. The last one creates share button of type 'box_count'.


Default Facebook Like Button:
 <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.ShareButton" %>
 <%@ Register TagPrefix="fvk" TagName="sharebutton" Src="~/FVK/ShareButton.ascx" %>
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Facebook Share Button for ASP.NET</title>
    <meta name="description" content="ASP.NET Share button control for Facebook Connect web sites." />
 </asp:Content>
 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <fvk:sharebutton id="sharebutton1" Type="icon" runat="server" />
   <fvk:sharebutton id="sharebutton2" Type="icon_link" runat="server" />
   <fvk:sharebutton id="sharebutton3" Type="button" runat="server" Title="share" />
   <fvk:sharebutton id="sharebutton4" Type="button_count" runat="server" Url="http://vatlab.com" />
   <fvk:sharebutton id="sharebutton5" Type="box_count" runat="server" />
 </asp:Content>

 

Customer Testimonials

"We are using FVK to create Facebook games and applications on the .NET platform, taking advantage of the encapsulated behaviors (like Stream Publish, Invitation, Alert Publishing, etc.) included in the library. FVK has a real good cost-benefits relation, in comparision to develop our own Facebook .Net componentes and UI Controls. It's the best alternative for Facebook & C#."

Ignacio J. Raffa, CTO, Solotuweb

Customer Spotlight



Vote for your favorites

Facebook development platform
Contact   |  Refund Policy   |  Privacy Policy   |  EULA