title: Creating Facebook Application in asp.net
body: <p>I want to create a Facebook IFRAME applicaton with asp.net.  I just want to know should I need to host the application some where over internet?  If yes, how could I test my application on localhost?</p>
  
  <h3>Update:</h3>
  
  <p>I just want a simple app for displaying a user name with "Hello."  Can anyone show me the code for that with the complete web.config configuration?</p>
  
  <p>I'm trying this code </p>
  
  <p>using facebook.web;
  namespace TestFbApplication
  {
      public partial class _Default:facebook.web.CanvasFBMLBasePage
      {</p>
  
  <pre><code> facebook.Components.FacebookService _fbService = new facebook.Components.FacebookService();
   private const string FACEBOOK_APPKEY = "66a8278bb94d969247a80815bab686e5";  // From the Facebook application page
   private const string FACEBOOK_SECRET = "de76280e4ddaef72ac2166afe7ffb9d5";  // From the Facebook application page
      protected void Page_PreInit(object sender, EventArgs e)
      {
          base.RequireLogin = false;
  
          _fbService.IsDesktopApplication = false;
  
          _fbService.ApplicationKey = FACEBOOK_APPKEY;
          _fbService.Secret = FACEBOOK_SECRET;
  
          _fbService.IsDesktopApplication = false;
          _fbService.ConnectToFacebook();
  
          abc.InnerText = _fbService.users.getInfo().ToString();
  
      }
  </code></pre>
  
  <p>and it is throwing and Exception in the last line that that the object reference is not set.</p>