Facebook Send Status for ASP.NET

Sending 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.

Send Status ASP.NET control allows developers to integrate this Facebook functionality into ASP.NET pages without deep understanding of Facebook API. The control is based on Facebook Graph API JavaScript method, which used to publish post, and some HTML tags and JavaScript functions to imitate the same control from Facebook environment. All of implementing details are hidden from developer, and all you have to do is to add ASP.NET control and set properties to add it in application. The control also has an event handler that is called on successful posting of user message, and it allows developer to add additional code while updating the status.

To allow an application to update status, user has to grant permission to update status. It is typical done when application is started for the first time by the user, but if it is not done, the control has a link bellow text box to grant this permission (status_update). To read more about permissions, please look at Facebook Permissions ASP.NET control.

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.



Picture of Send User Status control:

The picture shows send/update user status ASP.NET control. Bellow a text box, there can be seen a link for granting status update permission. If permission is not granted, error will be displayed in the text box with red color.

status


Facebook Send Status 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 Send Status demo



Configuration

Configuration 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:
facebook login button asp.net
Event Name
Description
facebook login button asp.net
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.






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

 

Customer Testimonials

"An excellent product and excellent support response. I bought it because I was struggling with wall postings and invitations and it has solved that problem really well. I think that anyone just starting out on Facebook development with .Net and FDT should definitely use the starting kit, it will literally save weeks of time with all the silly little bugs and issues of Facebook and the FDT toolkit."

Bruce Savage, Managing Director SavageBee PTY LTD

Customer Spotlight



Vote for your favorites

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