FacebookWebContext.Current is always null

TroyVE

New Member
I am trying to edit some code written about two years ago.Basically, it is Facebook connect, where users can register my website using Facebook application. My javascript code for Facebook connect is :\[code\]<div id="fb-root"></div><script src="http://connect.facebook.net/tr_TR/all.js"></script><script> FB.init({ appId: '<%=Facebook.FacebookApplication.Current.AppId %>', status: true, cookie: true, xfbml: true }); FB.Event.subscribe('auth.login', function (response) { window.location.href = http://stackoverflow.com/questions/15692649/UrlAmpReplace('<%=this.FacebookLoginURL %>'); }); FB.Event.subscribe('auth.logout', function (response) { window.location.href = http://stackoverflow.com/questions/15692649/UrlAmpReplace('<%=this.FacebookLogoutURL %>'); });</script>\[/code\]If the user clicks the Facebook button, there a Facebook popup page appears and asks for authenticaion & authorication. After that one, user redirects my own registration page where I use \[code\]Facebook.Web.dll\[/code\] as following :\[code\] var fb = new FacebookWebClient(FacebookWebContext.Current); var result = (IDictionary<string, object>)fb.Get("/me"); this.smFacebookUserID = FacebookWebContext.Current.Session.UserId;\[/code\]... do some action..My problem is; \[code\]FacebookWebContext.Current\[/code\] always returns null and I cannot process further.Do you have any idea what i am missing?
 
Back
Top