title: How to clear ObjectDataSource cache manually
body: <p>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.</p>
  
  <p>I have:</p>
  
  <p><code>    &lt;asp:ObjectDataSource ID="SomeId" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="SomeMethod" TypeName="SomeType" EnableCaching="True" CacheDuration="9999" CacheExpirationPolicy="Absolute"&gt;
      &lt;/asp:ObjectDataSource&gt;
  </code></p>
  
  <p>I have read the similar question: <a href="https://stackoverflow.com/questions/2455930/where-does-the-objectdatasource-cache-data">Where does the ObjectDataSource cache data?</a> which links to: <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasource.enablecaching.aspx" rel="nofollow noreferrer">ObjectDataSource.EnableCaching Property</a>. It says that cache is stored in the Cache object (Page.Cache).</p>
  
  <p>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.</p>
  
  <p>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.</p>