title: How to build database driven webpages with Umbraco 5
body: <p>I am trying to use a database to deliver content to an umbraco site. In this example there is a db table containing Live-events.</p>
  
  <p>What I would like to build is this structure:</p>
  
  <ol>
  <li><p>/Events - (List all active events from a database)</p></li>
  <li><p>/Events/Details/1 - (details for event with id 1)</p></li>
  </ol>
  
  <p>As you can see the structure is a classic MVC way of doing this.</p>
  
  <p>The first solution I came up with involved doing the following:</p>
  
  <ol>
  <li>Create a SurfaceController with an Index method and a Details method    </li>
  <li>Define two child action macros to call the functions from 1.  </li>
  <li>Create two umbraco pages (/Events and a details childpage) and
  inserted the macros onto the pages.</li>
  </ol>
  
  <p>Here you can see the function definitions:</p>
  
  <pre><code>[ChildActionOnly]
  public PartialViewResult Index()
  [ChildActionOnly]
  public PartialViewResult Details(string guid)
  </code></pre>
  
  <p>The index page works fine, but the details macro never gets called with a parameter. Apparently Umbraco isn't smart enough to route parameters to macros inside pages.</p>
  
  <p>So my questions are:</p>
  
  <p>Is this the correct way to build database based content into the umbraco frontend?</p>
  
  <p>If not, then what is the preferred way in Umbraco 5?</p>
  
  <p>Does any sample code exist for this scenario?</p>
  
  <p>If you need more information please don't hesitate to ask.</p>
  
  <p>Thanks in advance
  Michael Wulff</p>