title: Limit the number of results in a Nested ASP.NET ListView
body: <p>Similar to <a href="https://stackoverflow.com/questions/1017959/limit-the-number-of-results-on-a-asp-net-listview">my other question</a>:</p>
  
  <p>I have a ListView bound to a Dictionary.  Then I have a nested ListView for the dictionary's value's integers.</p>
  
  <p>I need to limit the number of items bound to the nested list to something like 5, and show a more button in the template.</p>
  
  <p>I can't find a way to get the more button to work, and to correctly limit the number at the same time.  I have it working as one or the other right now.</p>
  
  <p>Any ideas? Thanks!</p>
  
  <p><strong>UPDATE:</strong>  </p>
  
  <p>The markup looks something like this:</p>
  
  <pre><code>&lt;asp:ListView runat="server" ID="MainListView" ItemPlaceholderID="PlaceHolder2"&gt;
      &lt;LayoutTemplate&gt;
          &lt;asp:PlaceHolder runat="server" ID="PlaceHolder2" /&gt;
      &lt;/LayoutTemplate&gt;
      &lt;ItemTemplate&gt;
          &lt;h1&gt;My Main ListView - &lt;%# Eval("Key") %&gt;&lt;/h1&gt;
          &lt;asp:ListView runat="server" ID="NestedListView" ItemPlaceholderID="PlaceHolder3"
          DataSource='&lt;%# Eval("Value") %&gt;' &gt;
          &lt;LayoutTemplate&gt;
              &lt;h2&gt;One of many Nested ListViews&lt;/h2&gt;
              &lt;asp:PlaceHolder runat="server" ID="PlaceHolder3" /&gt;
          &lt;/LayoutTemplate&gt;
          &lt;ItemTemplate&gt;
                  &lt;asp:LinkButton runat="server" ID="AnInteger" Text='&lt;%# Eval("value") %&gt;'&gt;&lt;/asp:LinkButton&gt;
                  &lt;br /&gt;
          &lt;/ItemTemplate&gt;
          &lt;/asp:ListView&gt;
          &lt;asp:LinkButton runat="server" ID="uxMoreIntegers" Text="More..." Visible="false" OnClick="uxMoreIntegers_Click"&gt;&lt;/asp:LinkButton&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:ListView&gt;
  </code></pre>