SQLDataSource Caching and Filtering

K

kurt.craver

I have a component control that I created as a UserControl which
contains a SqlDataSource control, a GridView control, a DropDownList
control, a TextBox control, and a Button control. The idea is that the
user can select a column from the DropDownList, enter some text to
search on in that column, and click the Button to perform the search.
Then only the records matching the search criteria for that column will
be displayed.

The search capability is working, but the SqlDataSource is firing the
Selected event every time my UserControl updates the FilterExpression
of the SqlDataSource. The same thing happens every time the page of
the GridView is changed.

The SqlDataSource has EnableChacing set to true, DataSourceMode set to
DataSet, and the CacheDuration is set to Infinite. Isn't the purpose
of caching the SQLDataSource so that you can page through and filter
the result set without having to hit the database each time?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top