Steve Trefethen
Contact me Send mail to the author(s)
About Me View my LinkedIn profile

Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?

Archives
Statistics
Total Posts: 524
This Year: 26
This Month: 0
This Week: 1
Comments: 1835
Disclaimer
The posts on this weblog are provided �AS IS� with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer�s view in any way.
# Sunday, June 10, 2007
« FaceBook's Application Platform | Main | Round II with the "other" Stev... »

Developing Facebook applications in C# with ASP.NET

Tagged: ASP.NET | Development | Facebook

Tags:  |  | 
I mentioned previously I've created my first Facebook (FB) application (which is still under development) but I've learned a lot along the way. I haven't found the Facebook documentation very useful at all and have gleened a lot through Google, the Facebook developer group and simply tinkering with things. As a result I've put together some steps I think could help save you some time if you're looking to write a Facebook application using ASP.NET and C#. Btw, you'll get no help from facebook.com regarding ASP.NET development.

One thing that took me awhile was understanding how an FB application appears on your profile page. I eventually realized that FBML can be used to push markup onto a users profile page. This block of markup can be set at the time you create a new application though the first time around, if you're like me, this may see a bit confusing keep in mind I'm new new to FB itself so a lot of this was confusing. From the FB toolkit you can also use the method setFBML to programmatically set this block of markup. Needless, to say being used to MSDN documentation FB doc leaves a lot to be desired. That said there are a few tools you can use to play with the API as well as sample your FBML markup.

Facebook start app screenshot

At any rate, here are the steps I followed to get my application working. Note, the project includes support for Microsoft AJAX so you'll want to have that installed as well although you could just tweak the .aspx and web.config files and use it without AJAX. The screenshot illustrates what you should get when your done. NOTE: In the following steps several links won't work unless you have an FB account.

UPDATE: I've created a new page on my wiki with updated steps and a VS.NET starter kit to make this much easier.

Please let me know what problems you have or let me know if these steps need tweaking.

Was this helpful?

[Updated: June 11, 2007] Added link to an update page on my wiki with this content.

[Updated: Feb. 24, 2008] Since this post was written I've created two VS.NET starter kits, one for Facebook Dev Toolkit and Facebook.NET.

Related blog posts:

Comments [5] # permalink Posted @ 2:04AM
Wednesday, June 17, 2009 2:00:04 PM (Pacific Daylight Time, UTC-07:00)
This is great... I thought we were going to be stuck with PHP (barrrffff) for development. Thanks!
A. Developer
Friday, June 19, 2009 10:24:52 AM (Pacific Daylight Time, UTC-07:00)
Hi yes it was very useful although I'm wondering to know if i can add fbml tags on an iframe fb application. I lready have the application running fine with a datalist of images. I want to add a fb comment box and fb share button on each image of that datalist.
I've added it following the steps/references and etc but nothing is shown on the page but the datalist.
Is it possible to do that? I'm newbie and is quite confusing this iframe/fbml fb connect things.

Thanks, let me know if you need more details
Friday, June 19, 2009 10:33:36 AM (Pacific Daylight Time, UTC-07:00)
Luis,
You're going to need to do some research on using FBML from an iframe page. I suggest reading all of the links included in the Welcome.htm of the Starter Kit and get my example working first. There are lots of different settings that have to be made and while the Starter Kit does the bulk of the work for you, you should understand what it's doing if you're going to get it working.
Friday, June 19, 2009 3:12:28 PM (Pacific Daylight Time, UTC-07:00)
Thanks Steve, I knew that wasn't easy :^) . Ok I'll research about that a little more. I hope it don't be too complicated. Thank you very much!!!! Your article rocks!
Sunday, June 21, 2009 2:26:18 PM (Pacific Daylight Time, UTC-07:00)
Hi Steve
I have a problem with fbml permission tags.
When page load I want to pop up a box below

<fb:prompt-permission perms='email'>
Email gönderilsin mi ?
</fb:prompt-permission>

I placed it to ur sample XFBML.aspx page content part
when I run the page there is nothing.
do u have any suggestion to me ?
Thanks
Feyzullah
Comments are closed.