Add on the page:
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"> </script>
<script type="text/javascript">
FB_RequireFeatures(["XFBML"], function() {
FB.Facebook.init("<sec code>", "xd_receiver.htm");
});
function logoutfb()
{
FB.Connect.logout();
}
</script>
Now you can use it as your button in gridView:
<fb:login-button length="long" önlogin="window.location='abc.aspx'"></fb:login-button>