bri189a Posted June 22, 2006 Posted June 22, 2006 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: 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 I've found) to clear the cache on ObjectDataSource progamatically. What's the right way to do this progamatically? Quote
Diesel Posted June 22, 2006 Posted June 22, 2006 straight from the monkey's *** http://www.velocityreviews.com/forums/t123408-objectdatasource-caching-questions.html Quote
bri189a Posted June 22, 2006 Author Posted June 22, 2006 Yeah, that doesn't work. The way I came up with the hack I did was by trying to clear the Cache manually and ran into the same thing he did...there's nothing in the Cache object! Count == 0. Have you gotton this to work using this method? Maybe I'm just an idiot. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.