Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
$720 in referrals so far!

About/Contact

Steve Trefethen

Steve Trefethen is a Software Architect and Director of Software Training at Falafel Software in Capitola, CA. You can reach Steve here.

All opinions you read here are Steve's own and are not necessarily those of Falafel Software.

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

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.
If you're new here, you may want to subscribe to my RSS feed, follow me on Twitter, or subscribe via email. Thanks for visiting!

VS.NET starter kit for Nikhil Kothari's Facebook.NET

September 19 2007 4:06AM

Back in July Nikhil Kothari released Facebook.NET which is an ASP.NET wrapping of the Facebook API. Facebook.NET is a bit different approach than Facebook Developer’s Toolkit and provides some ASP.NET controls that wrap some of the more useful elements of the FB API. Nikhil and I exchanged a few emails back in July and he asked if I’d put this together but I’d just started a new job and was in the midst of remodeling my house and now things have settled down I decided to get it out

Use of this starter kit is very close to the previous one I released. The kit includes a Welcome.htm which is displayed in VS.NET when you create a new application that has all of the details of getting the two flavors of FB application (IFrame and FBML) up and running. One note, I tweaked the FB API version in FBML\Default.aspx since "0.3" is no longer supported.

Let me know if you have any problems. Download

[UPDATED: Jan 14, 2008] I updated the Starter Kit to v0.3 of Facebook.NET. Additionally, the starter kit has been updated to VS.NET 2008

[UPDATED: May, 6, 2008] Here are some additional links:

FacebookDel.icio.usDigg It!

Tags: Facebook

Comments

9/24/2007 11:19:06 PM #

Hey,

Ive just downloaded your facebook starter kit and managed to get it up and running, but when I go to fill out the optional fields, the only section I get is Base Options and none of the others?

It may be because Facebook hasnt installed the developer app properly (it doesnt show up in my apps and I have to add every time from the devlopers link at the bottom of the screen...)

Any ideas whats going on?

Karl |

9/25/2007 4:33:42 AM #

Hi Karl,
  Looks like I forgot one step (which I've added to Welcome.htm and updated the Starter Kit) which is, under Base Options to set "Can this application be added to Facebook?" to "Yes". That will cause the additional options to appear. It's very obscure, I agree.

Steve Trefethen |

9/25/2007 10:26:44 AM #

hi

i downloaded the starter kit above.

Then i opened Visual Studios and clicked on File - New - Website - and then selected the Facebook.NET template.

Then i clicked on the play button to debug the application. All it did was load the login page to facebook displaying a message saying "Invalid API..."

What should I do?

Thanks

carlito |

9/25/2007 10:48:25 AM #

i am now looking at the welcome.htm page.

Under point number 4 it says:

Under Base Options Callback URL -> http://localhost:nnnn/MyApp/default.aspx

Should I use the localhost address that you guys have provided or should I use my own???

carlito |

9/25/2007 11:38:33 AM #

I tried using my own localhost but no luck:

http://localhost:53464/Facebook.NET1/default.aspx

What should I do?

Thanks

carlito |

9/25/2007 12:14:21 PM #

i'm trying to download the file but it is not working it gives me the following message "can not load file or assembly MicroSoft.WizardFrameWork .............."

File Corrupted |

9/25/2007 3:54:41 PM #

Carlito,
  You need to be sure to follow all of the detailed instructions in Welcome.htm. I've had lots of people use the Starter Kit successfully so I know all the details are there.

Your local URL will be specific to your application. In the example you'll need to supply "nnnn" which is the port number and "MyApp" which is your applications virtual directory.

Steve Trefethen |

9/25/2007 3:58:06 PM #

"File Corrupted",
I'd take a look at this page: www.codeplex.com/.../View.aspx?ThreadId=9037

Perhaps it will give you some insight on how to correct the problem. Sounds like your configuration may be a bit messed up.

Steve Trefethen |

10/1/2007 8:56:59 AM #

hi steve

thanks for your replies.

i think i have made some progress but i have encoutered another problems that is stalling me in my quest to conquer this facebook stuff.

I have completed all the steps on the welcome.html page including the "Configuring your application" section. But no luck. What is the application that you have created suppose to do?

What I keep getting when I go to http://apps.facebook.com/Facebook.NET1/
is "The page you requested was not found."

What do you suggest I do now?

Thanks for your help so far.

Look forward to your response.

carlito |

10/4/2007 10:10:00 PM #

I get the same error as well:

When I go to http://apps.facebook.com/Facebook.NET1/
is "The page you requested was not found."


Rosie |

10/4/2007 11:16:19 PM #

Does it require .net 2.0?

I'm getting this error:

Parser Error Message: The format of the file 'FacebookNET.Web' is invalid.

Chris Baril |

10/5/2007 10:33:59 PM #

Hello,

Installation of VSI seemed to be successful (devenv closed), but then I couldn't find it (not in create project, not in create web site).

I also tried "devenv /setup" and "devenv /InstallVSTemplates", but didn't help.

Any suggestion?

Thanks

MikeG |

10/5/2007 10:39:33 PM #

sorry for double post.

i think i figured out why it didn't work: ZIP files reports CRC errors when I tried to manually unzip it.

I am running this on Win 2003 Srv, thought I doubt this is the issue

MikeG |

10/6/2007 6:22:16 AM #

I see there was a mistake in Welcome.htm in step 4 where the callback should read:

http://localhost:nnnn/MyApp/default.aspx

The "default.aspx" was missing and it's necessary.

My bad, sorry about that.

MikeG,
  I've downloaded the .vsi file on my site and installed it locally and it works just fine so I'm not exactly sure what you're running into.

Steve Trefethen |

10/6/2007 6:23:22 AM #

Chris,
  I've not tried Facebook.NET using .NET 1.1 only 2.0.

Steve Trefethen |

10/10/2007 4:31:27 AM #

Boy am I lost...  How do I work with Facebook.net under the webdeveloper studio?  I down lost the vsi but its only for c#, is there one for vb?  What reading do you recommend for complete noobies.

Aldo |

10/10/2007 9:51:08 AM #

Yup, I can't install it either, as it's only for C#??

Shem |

10/10/2007 5:10:37 PM #

Aldo,
Facebook.NET is just an assembly like any other, it does have a few controls that can be added to your toolbox but that's neither here or there really. The starter kit is intended to help you get a project up and running quickly so just create a new website and look at the project files.

I'm not familiar with VB so, no there is no VB version though since there is hardly any code converting this version to VB should be a piece of cake. I supposed I could create a VB version but that's not high on my list right now.

To successfully write Facebook applications you should familiarize yourself with the Facebook API and not just Facebook.NET.

Shem,
Why can't you install it? As I mentioned above there is hardly any code in the app so converting it to VB should be a no-brainer.

Steve Trefethen |

10/10/2007 6:59:58 PM #

Steve,

I added the callback URL to my app in facebook as:

http://localhost:nnnn/MyApp/default.aspx


and I am using the Hello, World! example from Facebook.NET (using iframes).  The app's initial canvas page works, however when I click on the link to "Browse Photos" which is defined in my default.aspx page as:

<fb:FacebookHyperLink runat="server" id="photosLink" NavigateUrl="Photos.aspx" Text="Browse Photos" />

... I receive an HTTP 404 - not found error, and the debug info shows the following requested url:

Requested URL: /TestApp/default.aspxPhotos.aspx


Why is facebook treating default.aspx as root?  (I tried taking default.aspx out of the callback URL string, this doesn't work either)

Thanks for your help

Alex L |

10/10/2007 7:51:50 PM #

Found the solution:

the callback URL should be:

http://localhost:nnnn/MyApp/

without default.aspx. However it should contain the slash at the end.

Alex L |

10/11/2007 2:35:44 PM #

Thanks Alex,
  I've been going back and forth on that and I'll fix the kit.

Steve Trefethen |

10/16/2007 2:57:35 PM #

Great work Steve. It seems like a small thing, but this kit will be a huge jumpstart for a lot of developers. Your work is much appreciated.

I've got to concur with the suggestion about the callback URL. The best strategy is sans page name.

drasticp |

10/16/2007 8:55:51 PM #

Hi drasticp,
Thanks! I'm glad you've found it useful. I just uploaded a new version which fixes the Callback URL documentation and tweaked the Starter Kit so that it opens Welcome.htm upon the creation of a new Facebook.NET web site.

Steve Trefethen |

10/17/2007 4:01:58 AM #

For all people having page not found probs ... read this

blog.jeromeparadis.com/.../...d-not-foundquot.aspx

dnew |

10/18/2007 7:39:30 AM #

Hi,
Thank you for your article.
My question is about Facebook Toolkit of Microsoft.
Do you have any idea about, how to display multi-friend selector for inviting people in IFrame based applications?
I did it in FBML application, but because postbacks, scripts etc are not allowed in FBML, it does not fulfill with my needs.

Can you please help?
Thanks

Ilhan Ercan |

10/18/2007 4:25:09 PM #

Hi Ilhan,
  Since you can't use FBML in an IFrame you'll need to write your own multi-friend selector.

Steve Trefethen |

10/21/2007 7:46:45 PM #

Ilhan,
Facebook does offer an IFrame version of their FBML multi-friend selector.  You can find the details at wiki.developers.facebook.com/.../Multi_friend_selector .

I am working on a control for rendering this version of multi-friend selector now but don't have anything ready to share yet.

Hope this helps,
-dk

dk |

11/5/2007 7:13:48 PM #

Steve,

Are you updating your VS tool with the pathces and updates at nikhil FacebookNET library?

I am new in this, if i downlaod nikhi's new source-relese and compile the dll, how can i add that to your tool without causing any trouble.

Taanks a bunch!

alam |

11/6/2007 10:45:41 PM #

Hi alam,
The starter kit is up-to-date with the binary 0.2.1.0 release of Facebook.NET which is the latest release from codeplex. If the assemblies are updated all you should have to do is download them and overwrite the existing versions.

Steve Trefethen |

11/15/2007 2:14:39 AM #

Do you have any basic code for default.aspx.cs that would demonstrate how to get the usersid, list of users friends, etc?  

I'm trying something simple like this in _load:
Facebook.Web.FacebookApplication fb = new Facebook.Web.FacebookApplication();
this.lblUser.Text = fb.Session.UserID;

Really interested in this, and a bit hesitant to try the Microsoft.NET toolkit.

Dustin |

3/19/2008 12:53:38 PM #

Hi Steve
        Good work done.
I have a doubt in this. I have created my own application in Facebook and when i open the application it works fine.
1. But when i submit my application to the Directory the following message appears
"Your application must have at least 5 users before you can submit it to the Application Directory. We cannot showcase any applications that are under construction or do not utilize the Facebook Platform."
How to solve this problem. How can i invite users(my friends)
2. When my facebook friend opens my application ("http://apps.facebook.com/foretee/"), she gets an error as

"The page you requested was not found.
You may have clicked an expired link or mistyped the web address (some urls are case sensitive).
Return home
Go back to the previous page"


Please help me out in solving this problem.

Thanks in advance...

Gayathri |

3/19/2008 3:05:17 PM #

Gayathri,
  I had no problem getting my application added to Facebook. I think you need to check the settings on your application. For more help, I'd suggest posting to the Facebook developers forums.

Steve Trefethen |

3/31/2008 1:29:46 PM #

Hi,

I will try to devlope a facebook application in asp.net with C#.This is in ifarame.But when i will tring to implement it hall page of facebook is show in canvas.

soni umesh |

4/27/2008 1:30:47 PM #

hi Steve,

I just downloaded .vsi and am going through the welcome.htm, I noticed that you repeat yourself in the welcom.htm the same information in step 6 as in step 5 'Under Installation options', please let me know if I'm missing something.

Thanks,

Zubair.NET! |

4/28/2008 12:35:14 AM #

Hi Zubair.NET!
  Thanks for the comment. I'll make sure to fix this the next time I update the Starter Kit.

Steve Trefethen |

4/29/2008 11:55:28 PM #

Hi Steve,
Actually I want only to thank you about your greate effort specially your answers to help others. I really learn alot from you.
I am also like your smile too ;D

Thank you,
Mohammed Elkhodary
EGYPT

Mohammed Elkhodary |

4/30/2008 11:31:32 AM #

hi again Steve,

I have a question that I hope you can answer. I'm developing using Facebook.NET, I use Profile.setFBML to show the content on my profile but it doesn't appear when my friends view my profile, any ideas ?

Zubair.NET! |

5/2/2008 5:21:41 AM #

Hi Mohammed,
  Thanks very much for the comment and kind words, most appreciated.

Steve Trefethen |

5/6/2008 8:06:51 PM #

I just downloaded vsi but when I am trying to run it I get this error:
“One or more content items contained within the .vscontent file cannot be installed because the correct version of the content installer component cannot be found.
Contact the author of the content file for information about which installers and versions are required.”
Any help would be appreciated.

Sergey |

5/6/2008 8:49:08 PM #

Hi Sergey,
  If you check the last note at the bottom of this post you can see that I updated the Starter Kit to VS.NET 2008. If you're using 2005 you'll see this error. You can still get at the files by renaming the .vsi file to .zip and extracting the contents. If I get a chance I'll look at posting a VS.NET 2005 version but I can't say I'll get to that soon.

Steve Trefethen |

5/7/2008 10:45:56 AM #

hi Steve,

sorry for re-posting this, any ideas why my friends cannot see my application box on my profile ?

Zubair.NET! |

5/7/2008 4:30:40 PM #

Zubair.NET,
  I'd suggest posting to the FB developer forums.

Steve Trefethen |

6/12/2008 1:07:48 PM #

Hi Steve,
I followed your steps, but when I run it in the FireFox, it gave me this error:

The page you requested was not found.

You may have clicked an expired link or mistyped the address. Some web addresses are case sensitive.

    * Return home
    * Go back to the previous page


What's wrong?

James Maclory |

6/12/2008 3:03:19 PM #

Hi James,
  That's not much to go on but I'd guess it has to do with your FB app settings and specifically the callback url.

Steve Trefethen |

6/12/2008 3:17:13 PM #

Hi Steve,
I think so too, because I can't the Site Nav and the Edit URL under the Installation Options.
What's wrong? Is my version of the Facebook wrong?

James Maclory |

6/12/2008 4:00:29 PM #

Hi James,
  I don't know what you're referring to by "Site Nav" as I don't see that on the FB app settings page anywhere. The URL you want to focus on is Callback URL, the third item down under "Base Options".

Good luck!

Steve Trefethen |

6/12/2008 4:35:14 PM #

Hi Steve,
I did it just following your article : http://www.stevetrefethen.com/wiki/Facebook%20application%20development%20in%20ASP.NET.ashx?NoRedirect=1.

So I think I must miss something.

I'll try it again,thank your help anyway.

James Maclory |

8/5/2008 9:15:13 AM #

Hi Steve Trefethen,

When I use given code snips I am getting these type of error.

my requirement is, i want to get friend list. Through api nothing else.

it is very urgent. Please solve this problem as soon as possible.



Email -dhananjayk1@halosys.com




Received HTTP error code 500 while loading http://trikonnetworks.com/facebook/Groups.aspx

There are still a few kinks Facebook and the makers of AdBhai are trying to iron out. We appreciate your patience as we try to fix these issues. Your problem has been logged - if it persists, please come back in a few days. Thanks!

------------------------CODE-------------------------------
            Collection<Facebook.Entity.User> f = new Collection<Facebook.Entity.User>();

            f = _fbService.GetFriends();
            GrpDv.InnerHtml = "Have Friends " + f.Count; // GrpDv is a Div with Runut server tag

------------------------CODE-------------------------------



With best Regards



Dhananjay Kumar


Dhananjay kumar |

8/6/2008 2:32:43 AM #

Dhananjay,
  I'm sorry but this isn't my problem to solve, certainly not for free. If you're interested in consulting work on this please let me know.

Steve Trefethen |

8/10/2008 2:16:06 PM #


Thanks a lot for your work.

I'm getting the following error when i try to run the application:

The type or namespace name 'CanvasIFrameMasterPage' could not be found (are you missing a using directive or an assembly reference?)

do you have any idea on how to solve the problem?

thanks again

Mahdi Ghurayeb |

8/11/2008 4:09:18 AM #

Mahdi,
  First, the CanvasIFrameMasterPage is for the Facebook Developer Toolkit not Facebook.NET. Regardless, the error you mention is caused by a missing or out dated assembly reference. Be sure you're using the v1.7 version of the Facebook Developer Toolkit. I have not updated my Starter Kit for the v2.0 release.

Steve Trefethen |

8/12/2008 6:54:49 PM #

hey steve.
         Can u please help on how to create a facebook desktop application.. i m totally lost man.. wer do i start?? how do i proceed?? see all i know for now is i gotta use facebooknet dlls and then i create my application. wat next?? wer do i host it from??  wats my call back url??

even in developing i m not able to a auth_token..

           facebook.API ap = new API();
            ap.ApplicationKey = apikey;
            ap.Secret = apisecret;
            auth a = new auth(ap);
            string auth_token = a.createToken();
           // System.Net.HttpWebRequest r = new System.Net.HttpWebRequest();
          
            facebook.Schema.session_info sess = a.getSession(auth_token);

on executin the last line i get this exception

"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."



I AM TOTALLY Frustrated man..please help me out..

karthik |

8/19/2008 8:26:42 PM #

Hi,
I am experiencing the same problem: "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.". I am willing to help and debug should you give me a clue about what might be happening

https://me.yahoo.com/crick3r |

9/6/2008 9:06:13 AM #

Hi,

I got the same problem with Facebook Developer Toolkit v2.0 (RC2) release. This doesn't happen with v 1.7 so I guess it's a bug that will be fixed in final release.

Alex

AP |

9/17/2008 3:25:15 PM #

Hi Steve

I  downloaded your FaceBook.Net template, i follow your step by step to set-up an application.

But when i launch it with the Canvas Url it redirect me to the facebook home page

I dont know why

Can you help me to start the project ?

Thx for all, and really good work you do here

Hassan Lagardere |

10/14/2008 8:08:33 AM #

hi Steve,

              I've created fbml application by referring your article. I'm facing issue is when user is not logged in and opens up app using http://apps.facebook.com/udaw_app/   it gives an error.
error : You may have clicked an expired link or mistyped the address

             But if user is logged in than it's working fine and asks.

Thanks,
Sandip

sandip |

10/14/2008 8:14:31 AM #

Hi Steve,

            I'd created application using facebook toolkit of previous version in asp.net. It has a function FBService.GetFriends(). Previously it was working fine. But recently it was giving an error.
- Requested value 'BJP' was not found

I don't want to use latest version of Facebook toolkit. What to do ?

Thanks,
Manoj

manoj |

11/11/2008 12:40:11 AM #

Steve,

Solid work on the kit.  

Do you know what the steps would be to integrate the kit into an already existing asp.net application? Reason being is that I would like my FB app to interact with data on my hosted asp.net application.

I would assume that I would need to add the refs/assemblies, change the web.config, and add the new aspx pages (default, postadd, etc).

thoughts?

Thanks,

SurfZ

Surf |

11/11/2008 7:20:13 AM #

Hi Surf,
  Thanks for the comment. I don't think it would take much work. Review the code in the kit (there's not much) and you'll need to apply the changes in the web.config related to the apikey and secret. Also look at the assembly references and add them to your application. That said I haven't worked with Facebook.NET as it's well outdated AFAIK. I've been putting my focus on the Facebook Developer Toolkit which has just released v2.0 and I'd recommend taking a look at.

Steve Trefethen |

11/11/2009 11:12:42 PM #

I've recently just started using your Facebook.NET Starter Kit to develop my web application. I added my own codings in order to make my application work. Previously, I have been using VB.NET to develop my application which is working but now I've used the Facebook.NET Starter Kit to integrate my application in facebook. Whenever I run my application through the facebook, it would always need my login username and password and I always got this error message which says (Unable to cast object of type 'System.Int64' to type 'System.String').

Your help will be appreciated.
Thanks.

Saw Hui Ying Singapore |

4/11/2010 7:53:53 AM #

The post is in reality the great on this worthy subject. I match in together with your conclusions and searching forward for your coming updates. Just saying many thanks will not just be enough, for the wonderful clarity in your writing. I've grabbed your rss feed to remain informed of any updates. Gratifying job and a lot achievement inside your business dealings!

Abdul Emerson United States |

Comments are closed