Facebook Like Gate for ASP.NETFacebook Like Gate is very popular feature used in Facebook Page applications to provide different content depending on the user fan status. Usually it can contain some kinde of a coupon or similar content. Facebook Like Gate ASP.NET control is an easy way to integrate the Like Gate inside ASP.NET pages. 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.
ConfigurationConfiguration of the Facebook Like Gate ASP.NET control is done in ASPX page by setting event handlers to execute one code in case of like and another in case of dislike. 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 properties and event handlers. Properties and event handlers:
Property Name
Type
Description
Liked
String
Return true if the user is fan of a page, false if not
OnLike
Event Handler
Execute when user likes a page
OnUnlike
Event Handler
Execute when user unlikes a page
Usage Examples:Following examples show registration and insertion of Facebook Like Gate ASP.NET control in ASPX file. The first example shows the default Facebook Like Gate without any property set. The second example shows the Facebook Like Gate with the event handlers 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 Send Button inside ASP.NET page are highlighted. Default Facebook Like Gate: <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.LikeGate" %> <%@ Register TagPrefix="fvk" TagName="likegate" Src="~/FVK/LikeGate.ascx" %%> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"%> <title%>Facebook Like Gate for ASP.NET</title%> <meta name="description" content="ASP.NET implementation of Facebook Like Gate in C# and VB.NET" /%> </asp:Content%> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%> <fvk:likegate ID="likegate1" runat="server" /%> </asp:Content%> Facebook Like Gate with event handlers set: <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.LikeGate" %> <%@ Register TagPrefix="fvk" TagName="likegate" Src="~/FVK/LikeGate.ascx" %%> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"%> <title%>Facebook Like Gate for ASP.NET</title%> <meta name="description" content="ASP.NET implementation of Facebook Like Gate in C# and VB.NET" /%> </asp:Content%> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%> <fvk:likegate ID="likegate1" runat="server" OnLike="DoLike" OnUnlike="DoUnlike" /%> </asp:Content%> |