I am unable to find an answer to simple question: How to clear ObjectDataSource cache manually -- from my C# code. Using ASP.NET with .NET v4 in Visual Studio 2010 with some DevExpress components.
I have:
<asp:ObjectDataSource ID="SomeId" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="SomeMethod" TypeName="SomeType" EnableCaching="True" CacheDuration="9999" CacheExpirationPolicy="Absolute">
</asp:ObjectDataSource>
I have read the similar question: Where does the ObjectDataSource cache data? which links to: ObjectDataSource.EnableCaching Property. It says that cache is stored in the Cache object (Page.Cache).
All other advices I have found, leads to Cache object. The problem is: Cache is empty for me, and Cache.Remove(ObjectDataSourceID.CacheKeyDependency); does nothing.
The caching mechanism works even when Cache is empty. Changing EnableCaching to false disables cache, but after setting it to true, it enables cache back with cached old values.