http://www.aspsnippets.com/Articles/Fetch-and-import-FaceBook-Friends-and-Contacts-with-profile-pictures-in-ASPNet.aspx
I tried that code it works well but i have different question. As i said code works well but after fetching data my page is giving error.
Fetching data page on your demo > http://www.aspsnippets.com/demos/254/default.aspx?code=AQC9FCQDNLoWSJwEHLxjmU3a32KGoZHe4-nQaW3KrjsjWNqAw9wlhpAhRUK2ruaCV9GLA4oQ-2FwPDae7MLwKaH_ic6G4SQXQL98hkL3JIs1IiCXSokkgRXVPmgiqdWR6nqiHzueCfwrqRf8dJ6eTZbz3FTP_SzV5SwGuNZmFJBKVQMWH31YUNeFdl3AEGKqYNUWS5bW8WJ01EKJyjHnpeVgPSZN89OsUuisWMT9E5lT3ZB66OfFq10mfw8__CfAADANsw9dY5DPXovI0nv8cXXgJVJ59Oyg6RIVce176eTSG9OueCJK1ampgZBXV6TBsM8#_=_
When i tried to refresh that page i am getting "The remote server returned an error: (400) Bad Request" error.
Here is the error.
You can see from here too > http://www.mycollection.in/Facebook/
click button, give permission and wait. Then it is done refresh the page.
The remote server returned an error: (400) Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.
Source Error:
Line 19: if (!string.IsNullOrEmpty(code))
Line 20: {
Line 21: string data = FaceBookConnect.Fetch(code, "me/friends");
Line 22: FaceBookData facebookData = new JavaScriptSerializer().Deserialize<FaceBookData>(data);
Line 23: foreach (FaceBookUser user in facebookData.Data)
Source File: c:\inetpub\vhosts\mycollection.in\httpdocs\Facebook\Default.aspx.cs Line: 21
Stack Trace:
[WebException: The remote server returned an error: (400) Bad Request.]
System.Net.HttpWebRequest.GetResponse() +6117395
ASPSnippets.FaceBookAPI.FaceBookConnect.WebResponseGet(String url) +134
ASPSnippets.FaceBookAPI.FaceBookConnect.Fetch(String code, String userId) +260
_Default.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\mycollection.in\httpdocs\Facebook\Default.aspx.cs:21
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272