I have a page with a number of drop down boxes and check boxes that the user can use to define a search against the database. There is also a ListView control that is supposed to display the results of the search. The ListView uses a DataPager defined in the ListView's LayoutTemplate to handle paging. Finally, I have a dynamic query built on the user's selections.
After much trial and error, numerous Google searches, and several posts, I finally got the dynamic query to work. It works in the LinqDataSource selecting event, and in the search button click event in that it returns the right records. But when I click the search button, I lose all paging ability.
ListView1.DataSource = InmProfile.ToList()
ListView1.DataBind()
is apparently not the same thing as a linqdatasource. How do I handle this? Can I somehow force the LinqDataSource selecting event to fire instead of or in addition to the search button click event, and leave the dynamic query in the LinqDataSource selecting event? Or do I assign the search button click event's query results to the ListView in a different way?
Diane