These are the steps
1. Install ASP.Net AJAX Extensions for VS2005.
2. Look for Extensions.dll in the following location
C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\System.Web.Extensions.dll
3. Add reference of this DLL in your project and use the following code
protected void Page_Load(object sender, EventArgs e)
{
FaceBookConnect.API_Key = "<Your API Key>";
FaceBookConnect.API_Secret = "<Your API Secret>";
if (!IsPostBack)
{
string code = Request.QueryString["code"];
if (!string.IsNullOrEmpty(code))
{
//Fetch User Albums
string data = FaceBookConnect.Fetch(code, "me/albums");
FaceBookAlbumData faceBookAlbumData = new JavaScriptSerializer().Deserialize<FaceBookAlbumData>(data);
//Search and Find "Profile Pictures" Album
foreach (FaceBookAlbum album in faceBookAlbumData.Data)
{
if (album.Name == "Profile Pictures")
{
//Fetch Images for the "Profile Pictures" Album
data = FaceBookConnect.Fetch(code, album.Id + "/photos");
album.Images = new JavaScriptSerializer().Deserialize<FaceBookImageData>(data).Data;
//The First Image is the Profile Picture of the user
imgProfile.ImageUrl = album.Images[0].Source;
imgProfile.Visible = true;
break;
}
}
}
}
}