Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Display all records before filtering from dropdown menu

$
0
0

I have a EntityDataSource object connected to a data source that displays all the records in a table when viewed in a browser. When I add a dropdownlist to the page and use the QueryExtender to connect to the dropdownlist, the data is automatically filtered by the dropdownmenu value when initially viewing the page. Everything works, but what I want to achieve is when the user initially views the page I want all the records to show. Only when the user selects a filter category from the dropdownmenu do I then want the data to be filtered upon postback.

Here is the EntityDataSource object code that I have using the QueryExtender. Is there a way to show all the records when initially viewing the page?

          <asp:EntityDataSource ID="faqsEDS" runat="server"
              ConnectionString="name=notebinderEntities"
              DefaultContainerName="notebinderEntities" EnableFlattening="False"
              EntitySetName="Frequently_Asked_Questions" Where="it.[publish] == true">
          </asp:EntityDataSource>
          <asp:QueryExtender ID="QueryExtender1" runat="server" TargetControlID="faqsEDS">
              <asp:PropertyExpression>
                <asp:ControlParameter ControlID="functionDDL" Name="fqCatID"  />
              </asp:PropertyExpression>
          </asp:QueryExtender>

Thanks in advance
Brad


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>