My Url is like below...
http://localhost:1561/Facebook/Facebook/MainPage
Controller Class
public class FacebookController : Controller
{
public ActionResult MainPage()
{
return View();
}
public PartialViewResult ShowMyDetails()
{
return PartialView("FacebookUserControl");
}
[CanvasAuthorize(Permissions = "user_about_me, publish_stream")]
public ActionResult GetMyDetails()
{
var fb = new FacebookClient();
dynamic CurrentUser = fb.Get("100003533388420");
User user = new User
{
id = CurrentUser.id,
first_name = CurrentUser.first_name,
gender = CurrentUser.gender,
last_name = CurrentUser.last_name,
name = CurrentUser.name,
username = CurrentUser.username
};
return Json
(
user,
JsonRequestBehavior.AllowGet
);
}
}
I don't have any Facebook related in my Web.Config.
Issue - In case I add below mentioned line. I am facing Issue "settings.AppId is null"
[CanvasAuthorize(Permissions = "user_about_me, publish_stream")]