User Control Page /Controls/FaceBookEntry.ascx (C#)
Uses Code Behind Page Page /Controls/FaceBookEntry.ascx.cs (C#)
1: <%@ Control Language="C#" AutoEventWireup="True" Inherits="FaceBookEntry" Codebehind="FaceBookEntry.ascx.cs" %>  
2: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">  
3:   
4: <script language="javascript" src="../Include/jquery.js"></script>  
5: <script  type='text/javascript'>  
6:     $(document).ready(function () {  
7:         $(".button").hover(function () {  
8:             $(this).attr("src", "/Images/SaveFaceBookHover.jpg");  
9:         }, function () {  
10:             $(this).attr("src", "/Images/SaveFaceBookNormal.jpg");  
11:         });  
12:     });  
13: </script>  
14:   
15: <table width="90%" border="0" CssClass="Content_Table" BorderColor="Blue" BorderStyle="Groove" BorderWidth="1" cellpadding="2" cellspacing="5" style="font-size: 7pt;font-family: Verdana,Arial,San-Serif;background-color: #99e7ff;">  
16:     <tr>  
17:         <td colspan="2">  
18:             <asp:Label runat="server" ID="lblName" Text="Login below" />  
19:         </td>  
20:     </tr>  
21:     <tr align="left" valign="top">  
22:         <td width="5%">  
23:             <fb:profile-pic uid="loggedinuser" facebook-logo="true" linked="false"></fb:profile-pic>  
24:         </td>  
25:         <td valign="top">  
26:             <table border="0" style="background-color: #ccffff;">  
27:             <tr>  
28:                 <td>  
29:                     <asp:Panel runat="server" ID="panelLoginButton" Visible="true">  
30:                         <fb:login-button autologoutlink='true' perms='read_stream,publish_stream' onlogin='window.location.reload()'></fb:login-button>          
31:                     </asp:Panel>  
32:                 </td>  
33:                 <td align="center">  
34:                     <asp:Label ID="lblMesageResult" Width="100%" style="color: black;font-size: 1.5em;font-variant: small-caps;font-weight: 200; text-transform: none;" runat="server" Text="Post my result below to my facebook"></asp:Label>  
35:                 </td>  
36:             </tr>  
37:             <tr>  
38:                 <td colspan="2"><asp:Label runat="server" ID="lblMessage" ForeColor="Blue"></asp:Label></td>  
39:             </tr>  
40:             <tr height="20px">  
41:                 <td></td>  
42:             </tr>  
43:             <tr>  
44:                 <td></td>  
45:                 <td align="center">  
46:                     <asp:ImageButton runat="server" class="button" ID="cmdFaceBook" ImageUrl="~/Images/SaveFaceBookNormal.jpg" OnClick="cmdFaceBook_Click"  />  
47:                 </td>  
48:             </tr>  
49:             </table>  
50:         </td>  
51:     </tr>  
52: </table>  
53:   
54:     <div id="fb-root"></div>  
55:     <script type='text/javascript'>  
56:         window.fbAsyncInit = function () {  
57:             FB.init({ appId: '<%= FacebookAppID %>', status: true, cookie: true,  
58:                 xfbml: true  
59:             });  
60:         };  
61:         (function () {  
62:             var e = document.createElement('script'); e.async = true;  
63:             e.src = document.location.protocol +  
64:           '//connect.facebook.net/en_US/all.js';  
65:             document.getElementById('fb-root').appendChild(e);  
66:         } ());  
67:     </script>  
68:   

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.