This documentation is archived and is not being maintained.

BasePartialCachingControl.Dependency Property

Gets or sets an instance of the CacheDependency class associated with the cached user control output.

[Visual Basic]
Public Property Dependency As CacheDependency
public CacheDependency Dependency {get; set;}
public: __property CacheDependency* get_Dependency();
public: __property void set_Dependency(CacheDependency*);
public function get Dependency() : CacheDependency;
public function set Dependency(CacheDependency);

Property Value

The CacheDependency instance associated with the server control.


This property allows you to remove user control output from the output cache when a file or key dependency changes.


[Visual Basic, C#] The following code example sets the Dependency property to a CacheDependency object that makes the control dependent on a text file. This example is part of a larger example provided for the BasePartialCachingControl class.

[Visual Basic] 
c.Dependency = New CacheDependency(MapPath("dep1.txt"))

c.Dependency = new CacheDependency(MapPath("dep1.txt"));

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

BasePartialCachingControl Class | BasePartialCachingControl Members | System.Web.UI Namespace