Friday 15 July 2011

c# - ASP.Net Facebook Web Applicatoin -


I'm looking at tutorial / samples / examples on creating a Facebook Web App using .NET (preferably C #) And it seems as everyone exists Razor MVC apps Are there any reason that no developer razors are making simple web apps on the net without MVC?

Any link from any web application that does not use razor or MVC will be appreciated.

Thank you

This is actually to cover the fundamentals of integration between Facebook and API to create I (asp.net web app)

I know that most app tutorials are using razor templates, but in choosing bits and pieces I have a standard MVC4 Facebook The app has been able to integrate. First of all, you have to add a standard MVC 4 template and Facebook package via NuGet Manager.

Enter your Facebook app details in the web. Confirm

  & lt; Add Key = "Facebook: AppId" value = "xxxxxxxxxxxxxxx" /> gt; & Lt; Add Key = "Facebook: AppSecret" value = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> & Lt; Add key = "Facebook: AppNamespace" value = "" /> & Lt; Add key = "Facebook: Authorization Redirect Path" value = "~ / Home / Permissions" /> & Lt; Add key = "Facebook: VerifyToken: user" value = "" />   

Your home administrator should look at something like this. [FacebookAuthorize ("email")] Public ASICNC work and lieutenant; Actionsclass & gt; Index (FacebookContext Reference) {if (ModelState.IsValid) {Session ["FacebookToken"] = Reference. AccessToken; Var user = wait for reference Client.GetCurrentUserAsync & lt; AppUser & gt; (); Return Redirect Reaction ("Index", "Account"); } Return Redirect Action ("Error", "Home"); } // This action will manage the redirect from FacebookAuthorizeFilter, when the // app does not have all the necessary permissions specified in FacebookAuthorizeAttribute I // The key of this action in the App Settings (web.config) key under 'Facebook: Authorization Redirect Path' Has been defined with. Public Functional Permissions (FacebookRDARC Reference Reference) {if (ModelState.IsValid) {Return View (Reference); } Return Redirect Action ("Error", "Home"); } Public Functionality FacebookInit () {Return partial view (); } Public functioning error () {return view (); }

The most important piece of code (and which caused me the most problems)

  var client = new FacebookClient (session ["FacebookToken"] ToString ()). Dynamic me = client.get ("me");   

You should get it started and Facebook API guide can help you with various user details that you can access.

No comments:

Post a Comment