Facebook Subscribe To Event for ASP.NETFacebook Subscribe to Event ASP.NET control is used to inform an application by executing event handler about an event made by a user. Event can be when somebody likes a page by pressing on Like Button or when somebody puts a comment in Facebook Comments Box. A list of all possible events is given under configuration section. 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 Subscribe to Event ASP.NET control is done in ASPX page by setting the event handler to execute a specific some code when a particular event occurs. If dynamic setting of properties is required, they can be also set in the code behind, for example on Page_Load method. Following tables shows the list of properties and the list of all possible events. Properies and Event handlers:
Property Name
Type
Description
OnEventTrigger
Event Handler
Execute some code when a particular event occurs
EventName
String
Name of the event, see the list bellow for details
ResponseValue
String
JSON formated string of response
Events
Event Name
Description
Login
Triggers when authorisation status changes to connected
Status
Triggers when login status changes
AuthResponse
Triggers when authorization response changes
Logout
Triggers when user logs out
Prompt
Triggers when user is prompted to log in
Render
Triggers when a call to FB.XFBML.parse() completes.
Like
Triggers when when user likes a page
Unlike
Triggers when a user unlikes a page
Comment
Triggers when when a user puts a comment in the Facebook Comments box
Uncomment
TTriggers when a user deletes a comment from the Facebook Comments box
Message
Triggers when when a user sends a message using Facebook Send Button
Usage Examples:Following examples show registration and insertion of Facebook Subscribe to Event ASP.NET control in ASPX file. The example shows Facebook Subscribe to Event configured to trigger on Like event. 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 the ASP.NET page are highlighted. Default Facebook Like Gate: <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.SubscribeToEvent" %> <%@ Register TagPrefix="fvk" TagName="sevent" Src="~/FVK/SubscribeToEvent.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 Subscribe to Event in C# and VB.NET" /%> </asp:Content%> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%> <fvk:sevent ID="sevent1" runat="server" EventName="Like" OnEventTrigger="OnLike" /%> </asp:Content%> |