This documentation is archived and is not being maintained.

PartialCachingAttribute.VaryByParams Property

Gets a list of query string or form POST paramaters that the output cache will use to vary the user control.

[Visual Basic]
Public ReadOnly Property VaryByParams As String
[C#]
public string VaryByParams {get;}
[C++]
public: __property String* get_VaryByParams();
[JScript]
public function get VaryByParams() : String;

Property Value

The list of query string or form POST parameters.

Example

[Visual Basic] 
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByParams
' property to ctlSelect.country, the full name of the form 
' POST parameter generated by the country DropDownList control.
<PartialCaching(20, "ctlSelect.country", Nothing, Nothing)>  _
Public Class ctlSelect
   Inherits UserControl

[C#] 
// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByParams
// property to ctlSelect.country, the full name of the form 
// POST parameter generated by the country DropDownList control.
[PartialCaching(20, "ctlSelect.country", null, null)]
public class ctlSelect : UserControl

[C++] 
// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByParams
// property to ctlSelect.country, the full name of the form 
// POST parameter generated by the country DropDownList control.
[PartialCaching(20, S"ctlSelect.country", 0, 0)]
public __gc class ctlSelect : public UserControl

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

Requirements

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

See Also

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

Show: