tramadol ambien online generic cialis online Here you can order Priligy or

canadian pharmacy

from the most popular canadian online pharmacy. buy tadalafil online levitra canadian pharmacy phentermine no prescription viagra valium pharmacy online http://www.canadianpharma.org/ cialistick cialis uk pharmacy tetenbaum cialis 3 day levitra

cialis online

zolpidem tartrate chaturvedi

pharmacy

viagra 800 number breastfeed tosh.0 viagra test buy modafinil yourselves endorsing cialis cialis medicare coverage overuse cialis long

canadian pharmacy

Facebook Stream Publish for ASP.NET

Facebook Stream Publish Pop-up is used to publish stories on the user wall, friends' walls, or on the page wall (if the user is admin). This control is a wrapper around Graph API JavaScript method FB.UI(), and it hides all complexities (like JSON conversion, media attachments packaging, etc.) from the user. The control uses configuration of the stream publish story, by exposing pure .NET objects with properties that the user can set to his liking. Events are also provided, for checking whether publish dialog is opened, and if the story is published. The control is available in C# and VB.NET programming languages, as part of Facebook ASP.NET (C# and VB.NET) Control library. Please also look at similar ASP.NET control at Facebook Stream Publish Friend List control.



facebook stream publish asp.net



Usage Examples:

Following example shows usage of Facebook Stream Publish ASP.NET control, from registration and insertion in ASPX file, to implementation of an event handler and setting of dynamic properties in the code behind. Implementation is given in C# and VB.NET programming languages.

Examples of ASPX files show 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 Stream Publish control inside ASP.NET page are highlighted. Note that the control uses its own JavaScript which is required to be included in every page where the control is used.


Integration in ASPX file:
 <%@ Page MasterPageFile="~/Master.Master" AutoEventWireup="true" Inherits="FVK_Demo.StreamPublish" %>
 <%@ Register TagPrefix="fvk" TagName="streampublishpopup" Src="~/FVK/StreamPublishPopup.ascx" %>
 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Facebook Stream Publish Control for ASP.NET</title>
    <meta name="description" content="ASP.NET Stream Publish popup control for Facebook Connect web sites." />
    <script type="text/javascript" src="/FVK/JavaScript/JSON.js"></script>
    <script type="text/javascript" src="/FVK/JavaScript/StreamPublishPopup.js"</script>
 </asp:Content>
 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <fvk:streampublishpopup ID="streampublish1" runat="server" 
       OnPublishCalled="OnPublishStory" OnConfirmCalled="OnConfirmStory"
       Name = "Facebook Visual Kit for ASP.NET"
       Href = "http://vatlab.com"
       Caption = "{*actor*} is trying Facebook Visual Kit Demo."
       Description = "Facebook Visual Kit is a set of ASP.NET user controls ..."
       UserMessage = "Try this ASP.NET library for Facebook development !!"
    />
 </asp:Content>




Code behind in C#:

Following code shows the code behind if you want to set image media, properties and action links in C# programming language. ActorId and TargetId are not set because story has to be published on selected user’s wall.

 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 StreamPublish : System.Web.UI.Page
    {
       protected void Page_Load(object sender, EventArgs e)
       {
          if (!Page.IsPostBack)
          {
             // set image media
             streampublish1.Media = new ImageData("logo.png", "url1");

             // set properties
             List properties = new List();
             properties.Add(new PropertyData("Text Property", "This is property description"));
             properties.Add(new LinkedPropertyData("Link Property", "This is property link", "url2"));
             streampublish1.Properties = properties;
             
             // set action links
             List linkList = new List();
             linkList.Add(new LinkData("action link", "url3"));
             linkList.Add(new LinkData("action link2", "url4"));
             streampublish1.ActionLinkList = linkList;
          }
       }

       protected void OnPublishStory(object sender, EventArgs e)
       {
          // stream publish popup dialog opened
       }

       protected void OnConfirmStory(object sender, EventArgs e)
       {
          if (streampublish1.ReturnedPostId != null)
          {
             //Story is published
          }
          else
          {
             // Story is not published
          }
       }
    }
 }




Code behind in VB.NET:

Following code shows the code behind if you want to set image media, properties and action links in VB.NET programming language. ActorId and TargetId are not set because story has to be published on selected user’s wall.

 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 StreamPublish
       Inherits System.Web.UI.Page
       Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
          If Not Page.IsPostBack Then
             ' set image media
             streampublish1.Media = New ImageData("http://vatlab.com/.../logo.png", "url1")

             ' set properties
             Dim properties As New List(Of IJSONSerialize)()
             properties.Add(New PropertyData("Text Property", "This is property description"))
             properties.Add(New LinkedPropertyData("Link Property", "This is property link", "url2"))
             streampublish1.Properties = properties

             ' set action links
             Dim linkList As New List(Of LinkData)()
             linkList.Add(New LinkData("action link", "url3"))
             linkList.Add(New LinkData("action link2", "url4"))
             streampublish1.ActionLinkList = linkList
          End If
       End Sub

       Protected Sub OnPublishStory(sender As Object, e As EventArgs)
          ' stream publish popup dialog opened
       End Sub

        Protected Sub OnConfirmStory(sender As Object, e As EventArgs)
          If streampublish1.ReturnedPostId IsNot Nothing Then
             'Story is published
          Else
             ' Story is not published
          End If
       End Sub
    End Class
 End Namespace




Configuration

Configuration of the Facebook Stream Publish ASP.NET control is done in ASPX page by setting properties and optional event handlers. If dynamic setting of properties is required, they can be also set in the code behind, for example on Page_Load method. If event handlers are used, there should be methods in the code behind to execute additional code after event handlers are executed. For Facebook Stream Publish ASP.NET control, all properties are optional. It is possible to create a story which contains only user comments. However, Stream Publish is frequently used to publish some pictures, videos and interesting stories. The control is very frequently used in Facebook quiz and gift applications, for example, to publish results of a quiz, or to publish that user is sending a gift to somebody. Because of that, for Stream Publish ASP.NET control, configuration of properties is usually done in the code behind, to depend on user actions. It is also possible to make a mix, with properties which are static to ASPX file, and dynamic properties which depend on user action in the code behind. For example, static properties can be Name and Href, while dynamic properties can be Description and Media. Definition of event handlers is always done in ASPX file, since it does not depend on user action.


Properties:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
CommandType
String
Can be set to 'link', 'button', or 'auto_open'. This means permissions popup dialog is opened by: pressing a link, button, or automatically on page load. Default value is 'button'.
facebook login button asp.net
CommandTitle
String
Text of stream publish button or link. If 'auto_open' command type is used, this parameter is ignored. Default value is 'Publish'.
facebook login button asp.net
Name
String
Name of the story. If this property is linked (if Href property is set), it is important to put relevant keywords inside name to raise search engine ranking of website or Facebook application.
facebook login button asp.net
Href
String
URL of the content inside website or Facebook application where story is pointing.
facebook login button asp.net
Caption
String
Caption of the story (first line below title). It is possible to include {*actor*} tag to write name of the user who published the story.
facebook login button asp.net
Description
String
Description of the story. The main text of the story. It has no limitation in length.
facebook login button asp.net
MessagePrompt
String
Message prompt is text displayed on top border of stream publish dialog.
facebook login button asp.net
UserMessage
String
Predefined user message. If user publishes a story, this text will be seen in news feed as he writes some comment about the story.
facebook login button asp.net
Media
IJsonSerialize
One of media objects (ImageData, VideoData, FlashData, or Mp3Data). Details about initializing media types can be found in following text.
facebook login button asp.net
MediaList
IList
List of media (IJsonSerialize) objects. Facebook currently supports only Image media type.
facebook login button asp.net
Properties
IList
List of PropertyData and LinkedPropertyData objects.
facebook login button asp.net
ActionLinkList
IList
List of action links (LinkData objects).
facebook login button asp.net
TargetId
String
Set to Facebook user id of a friend to publish on the friends' wall. ActorId must not be set.
facebook login button asp.net
ActorId
String
Set to page id to publish on Facebook page wall (only if user is admin of the page). TargetId must not be set.


Event Handlers:
facebook login button asp.net
Event Name
Description
facebook login button asp.net
OnPublishCalled
Has to be set to name of protected method that is implemented inside the code behind, and which will be called after Facebook Stream publish dialog is opened.
facebook login button asp.net
OnConfirmStory
Has to be set to name of protected method that is implemented inside the code behind, and which will be called after user confirms publishing of the story.




Media Types

Configuration of media types is done by creating new object with parameters in class constructor. It is also possible to create objects with default constructor and then set all properties of the objects. In following text, there are tables with descriptions of all constructor parameters and properties inside constructors, for each media type. Names of the properties and the constructor parameters are the same.


ImageData Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
ImageUrl
String
URL of image file
facebook login button asp.net
DestUrl
String
URL where user is redirected after a click on the image.


VideoData Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
VideoSrc
String
URL of video file
facebook login button asp.net
PreviewImg
String
URL of preview image.
facebook login button asp.net
VideoLink
String
Destination URL when video is clicked.
facebook login button asp.net
VideoTitle
String
Title of the video.
facebook login button asp.net
VideoLink
String
Destination URL when video is clicked.
facebook login button asp.net
VideoTitle
String
Title of the video.


MP3Data Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
Src
String
URL of mp3 file
facebook login button asp.net
Title
String
Song Title
facebook login button asp.net
Artist
String
Artist name
facebook login button asp.net
Album
String
Album name


FlashData Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
SwfSrc
String
URL of SWF file
facebook login button asp.net
ImgSrc
String
URL of preview image file.
facebook login button asp.net
Width
Int
Width of preview
facebook login button asp.net
Height
Int
Height of preview
facebook login button asp.net
ExpandedWidth
Int
Expanded Width
facebook login button asp.net
ExpandedHeight
Int
Expanded Height




Action Links

Action links are links which are located at the bottom of stream post. They are not visible in Facebook Stream Publish dialog, but only when story is published on user’s or Facebook page wall. They are used to provide more actions for your post. Action links are set by setting a list of LinkData objects to ActionLinks property. There is an example of this in Usage Example section. Following table shows properties (constructor parameters) of LinkData class.


LinkData Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
Text
String
Anchor text of the link
facebook login button asp.net
Href
String
Destination of the link.




Properties

Properties are name-value pairs, positioned bellow story description. Value is separated from name with one space character. On the picture above, you can see how it looks. There are 2 types of properties: text property and linked property. Linked property creates link (instead of plain text) with defined target URL. Tables bellow show properties (constructor parameters) of PropertyData (text property) and LinkedPropertyData classes.


PropertyData Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
Name
String
Name of property
facebook login button asp.net
Text
String
Text value of property.

LinkedPropertyData Class:
facebook login button asp.net
Property Name
Type
Description
facebook login button asp.net
Name
String
Name of property
facebook login button asp.net
Text
String
Anchor text of property.
facebook login button asp.net
Href
String
Destination URL of property
 

Customer Testimonials

"As a facebook "newby", developing a Facebook application is quite a challenge. You need to learn to Facebook concepts, the ever changing facebook APIs, working around APIs being depreciated. I found the libraries provided by Vatlab extremely helpful. Within hours I got the Facebook functions that I needed up and running. The documentation combined with the online tutorial was all that I needed.

"What also makes this product stand out in a IT world where decent product support is becoming a big issue, is the way developer of the libraries handled a question I had. The reply came very quickly and was to the point. It was a real pleasure to deal with him. I can only recommend this library and I’m sure that we will continue to see exciting new features in future."

Peter Cabus, Sr. Consultant, IT & Video Consultancy

Customer Spotlight



Vote for your favorites

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