https://developers.facebook.com/docs/facebook-login/getting-started-web/[
^]
this will defiantly solve your porblem
read and follow the instruction carefully.
i am adding the code as well.
.........................Code of .aspx Page add this page in your website.......................
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FB.aspx.cs" Inherits="FB" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div id="fb-root"></div>
<script type="text/javascript">
var chkURl = window.location;
if (String(chkURl).indexOf("http://") != -1) {
var _url = String(chkURl).split("http://");
chkURl = _url[1];
}
else if (String(chkURl).indexOf("https://") != -1) {
var _url = String(chkURl).split("https://");
chkURl = _url[1];
}
window.fbAsyncInit = function () {
FB.init({
appId: 'your app id',
channelUrl: chkURl,
status: true,
cookie: true,
xfbml: true
});
FB.Event.subscribe('auth.authResponseChange', function (response) {
if (response.status === 'connected') {
alert("111 connected");
testAPI();
} else if (response.status === 'not_authorized') {
alert("222 not_authorized");
FB.login();
} else {
FB.login();
}
});
};
(function (d) {
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) { return; }
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
} (document));
function testAPI() {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
alert('you are now login with fb');
console.log('Good to see you, ' + response.name + '.');
console.log(response);
});
}
</script>
<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button>
</form>
</body>
</html>
.........................Code of .aspx Page add this page in your website.......................