Facebook Send Status for ASP.NETSending or updating user status is frequently used action from Facebook environment, that is, when user news feed or user wall is displayed. It is usually used when user wants to express a feeling, opinion or share some news directly, without connecting to some external web content of Facebook application. However, sending or updating user status can also be done from Facebook application of Facebook Connect website. Sending a status in this way creates a post on user profile with link back to an application. In this way, user's friends are informed about the application which shared the content, and this increases it’s rating in search engines. The control are available in C# and VB.NET programming languages, as part of Facebook ASP.NET (C# and VB.NET) Control library.
![]() Usage Examples:Following example shows usage of Facebook Send Status ASP.NET control, from registration and insertion in ASPX file, to implementation of an event handler in the code behind. Implementation of the event handler is given in C# and VB.NET programming languages. Example in ASPX file shows only the required code 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 Invite Friends control inside ASP.NET page are highlighted. Note that for correct operation of Send status control, it is required to include additional JavaScript. Configuration in ASPX file: <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.SendStatus" %> <%@ Register TagPrefix="fvk" TagName="sendstatus" Src="~/FVK/SendUserStatus.ascx" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <title>Facebook Send User Status control for ASP.NET</title> <meta name="description" content="ASP.NET implementation of Facebook Update Status in C# and VB.NET." /> <script type="text/javascript" src="/FVK/JavaScript/SendStatus.js"></script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <fvk:sendstatus id="sendstatus1" runat="server" OnSendStatusCalled="OnSendStatus" /> </asp:Content> Code behind in C#: Following code shows the code behind to demonstrate the implementation of an event handler for updating status in C# programming language.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Facebook;
using FVK;
namespace FVK_Demo
{
public partial class SendStatus : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void OnSendStatus(object sender, EventArgs e)
{
// execute some code on updating user status
}
}
}
Code behind in VB.NET: Following code shows the code behind to demonstrate the implementation of an event handler for updating status in VB.NET programming language.
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Facebook
Imports FVK
Namespace FVK_Demo
Public Partial Class SendStatus
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
End Sub
Protected Sub OnSendStatus(sender As Object, e As EventArgs)
' execute come code on upadating status
End Sub
End Class
End Namespace
ConfigurationConfiguration of the Facebook Send Status ASP.NET control is done in ASPX page by setting optional event handler. If event handler is used, there should be a method in the code behind to execute additional code after the status is successfully updated. Event Handlers:
Event Name
Description
SendStatusCalled
Name of protected method that has to be implemented inside the page code and which will be called upon when the user status is successfully sent.
|