title: Using Razor script to randomly pick a page node in Umbraco
body: <p>The following code displays a testimonial item on the homepage of <a href="http://www.keelycattschoolofdance.co.uk" rel="nofollow">http://www.keelycattschoolofdance.co.uk</a> which works nicely:</p>
  
  <pre><code>@using umbraco.MacroEngines;
  @inherits umbraco.MacroEngines.DynamicNodeContext
  
  @{ 
  var numberOfItems = 1;
  DynamicNodeList pages = @Model.Children.Where("umbracoNaviHide !=    true").Take(numberOfItems).OrderBy("UpdateDate");
  }
  
  &lt;div&gt;
      @foreach (DynamicNode page in pages)
      {        
         &lt;h2&gt;@page.Name&lt;/h2&gt;
         &lt;p&gt;@page.GetProperty("introText")&lt;/p&gt;
         &lt;p&gt;&lt;a href="@page.Url"&gt;Read more...&lt;/a&gt;&lt;/p&gt;
         &lt;p&gt;&lt;strong&gt;@page.GetProperty("personsName")&lt;/strong&gt;&lt;/p&gt;                       
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to take this little script a stage further by selecting a random testimonial. How should I go about doing this?</p>