Dual listview binding help
<p>I have a listview of buttons(I wanted to have hyperlinks actually but have no idea how to execute without the onclick event) where I can click and show the sub categories products of a master category on another listview(already binded with products of master category table). This is my code below, apparently it does not work as expected and throws the error below:</p>

<p>"Both DataSource and DataSourceID are defined on 'ListView_Products'. Remove one definition."</p>

<p>Can someone please advice how to deal with this? Thanks.</p>

<p>Here is a "picture" of what I am trying to do:</p>

<pre><code>**ListView 1(Sub Category)**             **ListView 2(Master Category)**
         Cotton                                "ALL THE DRESSES"
         Silk                                           
</code></pre>

<p>So when I click cotton in ListView1, only dresses made of Cotton will be displayed on ListView2.</p>

<pre><code>&lt;asp:ListView ID="ListView_ProductsMenu" runat="server" 
            DataKeyNames="CategoryID" DataSourceID="EDS_Category_Menu" &gt;
            &lt;EmptyDataTemplate&gt;No Menu Items.&lt;/EmptyDataTemplate&gt;
            &lt;ItemSeparatorTemplate&gt;&lt;/ItemSeparatorTemplate&gt;
            &lt;ItemTemplate&gt;

                &lt;li style="color: #B6B6B6; text-align: left; font-family: candara; font-size: small;" class="SideMenu"&gt;


                 &lt;asp:Button ID="Button1" runat="server" Text='&lt;%# Eval("Category_Sub_Name")%&gt;' OnClick='&lt;%# FormattedCategory((int)Eval("CategoryID"),(int)Eval("Category_Sub_ID")) %&gt;'  /&gt; 

                &lt;/li&gt;
            &lt;/ItemTemplate&gt;               

            &lt;LayoutTemplate&gt;
                &lt;ul ID="itemPlaceholderContainer" runat="server" style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;
                    &lt;li runat="server" id="itemPlaceholder" /&gt;
                &lt;/ul&gt;
                &lt;div style="text-align: left;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;"&gt;&lt;/div&gt;
            &lt;/LayoutTemplate&gt;
        &lt;/asp:ListView&gt;
</code></pre>

<p><strong>Code behind:</strong></p>

<pre><code> protected string FormattedCategory(int cID, int subCatID)
    {
        using (CommerceEntities db = new CommerceEntities())
        {
            ListView_Products.DataSource = null;
            ListView_Products.DataSource = (from c in db.Categories_Sub
                                            where c.CategoryID == cID
                             &amp; c.Category_Sub_ID == subCatID
                          select c);         
            ListView_Products.DataBind();
            //foreach (var item in subCat)
            //{
            //     ListView_ProductsMenu.DataBind();
            // }
        }
        return null;
    }
</code></pre>
