
 Rank: Guest Groups: Guest
Joined: 9/17/2007 Posts: 11,670 Points: -1,200
|
Date parsed: 06/10/2007 02:58:35 Date: Sat, 06 Oct 2007 09:58:35 -0700
Hi,
I have a user control MyControl.ascx which appears on various pages in my ASP .NET 2.0 application. I have setup partial-page caching using OutputCache directive so that this control gets cached on each page. However, there is one page Update.aspx which contains the control and has features that update the DB entries that determine the output of the control.
I have set SqlDependency so that the control's cache is expired when the table is updated. But on this page, if I update the DB, the cache does not expire immediately, and hence when the page is returned back to the user the control still shows the older values. The cache is not expired immediately because the SqlDependency is only periodically refreshed to check if there is a change. Since the DB is updated on postback in an event handler, the postbacked page is returned with the older cached control.
Is there a way to expire the control's cache immediately so that the control on this page renders with the updated values?
Thanks, Yash
|