Facebook Like Button for ASP.NET

Facebook Like button is the most important component of the Facebook Graph API. Whole concept about Graph API is based on what people like. Likes make connections from people to other stuff like websites, products, movie, etc. When somebody presses like button on some product, a connection is created from this person to this product. Numerous connections from people to people as friends, and from people to stuffs they like, create a Facebook graph. Facebook Like Button ASP.NET control allows easy integration of Like Button in ASP.NET pages and dynamic configuration from the code behind and data sources. The control is available in C# and VB.NET programming languages, as part of Facebook ASP.NET (C# and VB.NET) Control library.



facebook like button




Usage Examples:

Following examples show registration and insertion of Facebook Like Button ASP.NET control in ASPX file. The first example shows default Like Button without any property set. The second example shows Like Button with all properties set. Examples of ASPX files show only the code required for registration and integration of ASP.NET control in a web page. To see all requirements for registered components, including JavaScript, CSS style and header setting, please look at the manual for page requirements. For following examples, all page requirements are placed in ASP.NET master page. Important parts for registration and integration of Facebook Like Button inside ASP.NET page are highlighted.


Default Facebook Like Button:
 <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.LikeButton" %%>
 <%@ Register TagPrefix="fvk" TagName="likebutton" Src="~/FVK/LikeButton.ascx" %%>
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"%>
    <title%>Facebook Like Button for ASP.NET</title%>
    <meta name="description" content="ASP.NET implementation of Facebook Like Button in C# and VB.NET" /%>
 </asp:Content%>
 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%>
    <fvk:likebutton ID="like1" runat="server" /%>
 </asp:Content%>

Facebook Like Button with all properties set:
 <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.LikeButton" %%>
 <%@ Register TagPrefix="fvk" TagName="likebutton" Src="~/FVK/LikeButton.ascx" %%>
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"%>
    <title%>Facebook Like Button for ASP.NET</title%>
    <meta name="description" content="ASP.NET implementation of Facebook Like Button in C# and VB.NET" /%>
 </asp:Content%>
 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%>
    <fvk:likebutton ID="like1" runat="server"
       Url="http://vatlab.com"
       Action="recommend"
       Font="tahoma"
       Layout="box_count"
       SetColorScheme="dark"
       ShowFaces="false"
       Width="550"
    /%>
 </asp:Content%>




Configuration

Configuration of the Facebook Like Button ASP.NET control is done in ASPX page by setting optional properties. Default like button, which is typically used, does not have any property set. However, customizations are always possible with properties setting. If dynamic setting of properties is required, they can also be 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
Url
String
URL of the like button. If it's not set, current page URL is used.
facebook login button asp.net
Layout
String
Layout type. Available values are 'standard', 'button_count', and 'box_count'. Default value is 'standard'.
facebook login button asp.net
ShowFaces
Bool
Set to true to show profile pictures of user's friends bellow the like button. Default value is true.
facebook login button asp.net
Width
Int
Width of the like button in pixels. Default value is 450.
facebook login button asp.net
Action
String
Text of the like button. Available values are 'like' and 'recommend'. It will be translated depending on user's language.
facebook login button asp.net
Font
String
Font inside the like button. Available values are 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms', and 'verdana'.
facebook login button asp.net
ColorScheme
String
Color scheme. Available values are 'light' and 'dark'. Default value is 'light'.
facebook login button asp.net
Reference
String
The reference string for tracking referrals.
facebook login button asp.net
Send
String
If set to true, send button will be shown right to the like button.
 

Customer Testimonials

"Save time and get your product done faster with this SDK. If you are looking for a solid foundation to build a Facebook Server application, I Highly recommend this SDK and the GiftApp. With extensive code examples and broad Coverage of all things that a typical Facebook app developer needs, you’ll hit the ground running."

Nader Rahimizad, CTO GamesBox Co., Ltd.

Customer Spotlight



Vote for your favorites

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