I want to clear cache on an object datasource through code, through Google I figured out from asp.net that if I do the following (where the original DefaultValue for the SelectParameter = "ORIGINAL"), the cache will get cleared:
This in essence marks the parameter dirty causing the ObjectDataSource control to internally call OnParameterChanged which clears the cache (thank you Reflector!). This is a hack at best to get around the problem that there is no way to directly (that Ive found) to clear the cache on ObjectDataSource progamatically.
Whats the right way to do this progamatically?
C#:
ObjectDataSource1.SelectParameters[0].DefaultValue = "Original";
ObjectDataSource1.SelectParameters[0].DefaultValue = "ORIGINAL";
This in essence marks the parameter dirty causing the ObjectDataSource control to internally call OnParameterChanged which clears the cache (thank you Reflector!). This is a hack at best to get around the problem that there is no way to directly (that Ive found) to clear the cache on ObjectDataSource progamatically.
Whats the right way to do this progamatically?