Hi
I got my solution may be it can help you or other members
<div class="fb-login-button" scope="email">
Login with Facebook
</div>
<script type="text/javascript">
(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));
// Init the SDK upon load
window.fbAsyncInit = function() {
FB.init({
appId: 'your app id', // App ID
channelUrl: '//' + window.location.hostname + '/channel', // Path to your Channel File
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
// listen for and handle auth.statusChange events
FB.Event.subscribe('auth.statusChange', function(response) {
if (response.authResponse) {
// user has auth'd your app and is logged into Facebook
var uid = "http://graph.facebook.com/" + response.authResponse.userID + "/picture";
FB.api('/me', function(me) {
document.getElementById('<%=hfConfirmValue.ClientID %>').value = me.email;
document.getElementById('<%=hdnConfirmName.ClientID %>').value = me.name;
var clickButton = document.getElementById("<%= Button1.ClientID %>");
clickButton.click();
})
}
});
}
</script>
<input type="hidden" id="hfConfirmValue" runat="server" />
<input type="hidden" id="hdnConfirmName" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
and Code behind
protected void Button1_Click(object sender, EventArgs e)
{
AddFBAccount(hdnConfirmName.Value, hfConfirmValue.Value);
}