Facebook Request Dialog for ASP.NET
Facebook Request Dialog is new Facebook component used for inviting friends to start using Facebook application or Facebook Connect website, and for requesting particular action from friends who already use the application. Facebook Request Dialog component is intended to be replacement of
Facebook Invite Friends component based on XFBML which is becoming deprecated. Since Facebook Request Dialog still lacks some features in comparison to Invite Friends (for example, getting the list of invited friends), it still cannot be replacement for all applications, especially old ones. However, it has some other features and advantages, and it is strongly recommended for usage in new applications, instead of Invite friends.
Picture of Facebook Request Dialog: Following picture shows Facebook Request Dialog. Pictures of friends and last names are hidden, because of privacy protection.
Facebook Request Dialog 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 Request Dialog demo
ConfigurationConfiguration of the Facebook Request Dialog ASP.NET control is done in ASPX page by setting mandatory property Message and other optional properties. 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:
Property Name
Type
Description
Message
String
Message of request dialog.
Title
String
Title of request dialog.
FriedId
String
Id of friend to which request has to be sent. If omited, friend selector is shown.
AdditionalData
String
Optional data which is sent with request.
CommandType
String
Can be set on 'link', 'button', or 'auto_open'. This means request dialog is opened by pressing a link, button, or automatically on page load. Default value is 'button'.
CommandTitle
String
Text of command button or link. If 'auto_open' command type is used, this parameter is ignored. Default value is 'Send Request'.
Usage Examples:Following examples show registration and insertion of Facebook Request Dialog ASP.NET control in ASPX file. The first example shows default Request Dialog with only Message property set. The second example shows Request Dialog 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 Request Dialog inside ASP.NET page are highlighted. Default Facebook Request Dialog: <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.RequestDialog" %> <%@ Register TagPrefix="fvk" TagName="requestdialog" Src="~/FVK/RequestDialog.ascx" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"%> <title%>Facebook Request Dialog for ASP.NET</title%> <meta name="description" content="ASP.NET implementation of Facebook Request Dialog in C# and VB.NET" /%> </asp:Content%> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%> <fvk:requestdialog ID="request1" runat="server" Message="Join to my application" /%> </asp:Content%> Facebook Request Dialog with all properties set: <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.RequestDialog" %> <%@ Register TagPrefix="fvk" TagName="requestdialog" Src="~/FVK/RequestDialog.ascx" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"%> <title%>Facebook Request Dialog for ASP.NET</title%> <meta name="description" content="ASP.NET implementation of Facebook Request Dialog in C# and VB.NET" /%> </asp:Content%> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"%> <fvk:requestdialog ID="request1" runat="server" Message="Join to my application" Title="Request dialog" FriedId="23876283618381" AdditionalData="Type: 3, Item: 2" CommandType="link" CommandTitle="Request Item" /%> </asp:Content%> |