troubleshooting Question

ObjectDataSource Caching & Filtering

Avatar of espadana
espadana asked on
ASP.NET
2 Comments1 Solution1615 ViewsLast Modified:
Hi,  I have been stock on this issue for a while now, and would be very gratful if you could help.

I am binding an Objectdatasource to a gridview to display some data.  I have letters A-Z as linkbuttons on top of the gridview, so that when user clicks a letter, the data in gridview is filtered and only those starting with that letter are shown.  The ODS cache duration is set to 360 seconds.

I have managed to get caching and filtering to work on their own, but not together.  When both are used,  and I click on a letter to filter the data, the code always calls the function to get data from database, and does not use cached data (i.e. I am trying to filter the data cahced in the ODS). below is the code for my ODS:

------------------------
<asp:objectdatasource id="ObjectDataSource1" runat="server" CacheDuration="360" EnableCaching="True" selectmethod="GetFeedData" typename="DataFunctions" FilterExpression="Name LIKE '{0}%'">
    <selectparameters>
    <asp:Parameter Name="SearchID" DefaultValue="502185" Type="int32"  Direction="Input" />
    <asp:Parameter Name="FilterID" DefaultValue="502186" Type="int32"  Direction="Input" />
    <asp:Parameter Name="CompanyID" Type="int32"  Direction="Input" />
     <asp:Parameter Name="PagingLetter" DefaultValue="A" Type="string" Direction="Input" />
    </selectparameters>
    <filterparameters>
       <asp:Parameter Name="Paging" Type="String" DefaultValue="A" />
    </filterparameters>
    </asp:objectdatasource>
--------------------------
ASKER CERTIFIED SOLUTION
MogalManic

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros