title: Castle windsor property injection
body: <p>Im a windsor noob and im having some problems getting dependency injection to work. im using a asp.net web application.</p>
  
  <p>I have done the following</p>
  
  <pre><code>public interface IHandler{
      ...
  }
  
  public class Handler : IHandler{
      ...
  }
  </code></pre>
  
  <p>then i try to register the code in global.asax application_start</p>
  
  <pre><code>container.Register(Component
      .For(typeof(IHandler))
      .ImplementedBy(typeof(Handler))
      .Named("handler"));
  </code></pre>
  
  <p>When i want to use the Handler i create a property</p>
  
  <pre><code>public IHandler handler{get;set;}
  </code></pre>
  
  <p>but when i try to use it, it is null? why? am i missing someting?</p>
  
  <p>Best regards</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The only thing i doto register/resolve is the following:     </p>
  
  <pre><code>container.Register(Component
      .For(typeof(IHandler))
      .ImplementedBy(typeof(Handler))
      .Named("handler"));
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>container.Resolve&lt;IHandler&gt;();
  </code></pre>
  
  <p>Do i need to do something else, Does it work to run this att application start?</p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Can the problem ocour because im trying to dependency inject on an ascx controll?</p>