In this article I will show you how you can integrate
facebook like button in you asp.net application using c#.net.
Some of my previous articles are as follows: Theme
Creation for jQuery Mobile, Blinking
Text in C#.Net Windows Application, Focus
on TextBox in C#.Net in Windows Application, Hide
Or Show Gridview Column By Column Index at RunTime In Asp.Net Using C#.Net,
Hide
Or Show Gridview Row By Column Name at RunTime In Asp.Net Using C#.Net, Display
Grand Total In Gridview Footer On RowDataBound In Asp.Net Using C#.Net, Detect
Header Control and Assign Value of Gridview RowDataBound In Asp.Net Using
C#.Net, Merge
Header or Apply ColumnSpan to Header of GridView In Asp.Net Using C#.Net.
So for this first we will go to the given developer facebook
URL https://developers.facebook.com/docs/plugins/like-button/
. As you navigate the url you will get the below screen.
Now we will provide the like url.
Now for changing the like button look please check the below
screen
After changing the layout your like button look as shown below.
Now click on code generate button to get like button code
Now in this we will add the generated code.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.WebForm2"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Facebook
like button integration In Asp.net Using C#.Net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="fb-root"></div>
<script> (function
(d, s, id) {
var
js, fjs = d.getElementsByTagName(s)[0];
if
(d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=333340740099935&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script',
'facebook-jssdk'));</script>
<h2>Click to
like me : </h2><div class="fb-like"
data-href="http://www.aspdotnet-pools.com/"
data-layout="box_count"
data-action="like"
data-show-faces="true"
data-share="true"></div>
</div>
</form>
</body>
</html>
|
Now we have done. Run the application to check the output.
DOWNLOAD
0 comments:
Please let me know your view