StaticPartialCachingControl.BuildCachedControl 方法

定义

在用户控件(.ascx 文件)中生成一个 StaticPartialCachingControl 对象,并将其添加到用作容器的服务器控件。Builds a StaticPartialCachingControl object in the user control (.ascx file) and adds it to the containing server control.

重载

BuildCachedControl(Control, String, String, Int32, String, String, String, BuildMethod)

使用在用户控件(.ascx 文件)中指定的参数生成一个 StaticPartialCachingControl 对象,并将其作为已分析的子对象添加到用作容器的服务器控件。Builds a StaticPartialCachingControl object with the parameters specified in the user control (.ascx file) and adds it as a parsed sub-object to the containing server control.

BuildCachedControl(Control, String, String, Int32, String, String, String, String, BuildMethod)

使用在用户控件(.ascx 文件)中指定的参数生成一个 StaticPartialCachingControl 对象,并将其作为已分析的子对象添加到用作容器的服务器控件。Builds a StaticPartialCachingControl object with the parameters specified in the user control (.ascx file) and adds it as a parsed sub-object to the containing server control.

BuildCachedControl(Control, String, String, Int32, String, String, String, String, BuildMethod, String)

为 .ascx 文件中定义的控件生成 StaticPartialCachingControl 类的新实例。Builds a new instance of the StaticPartialCachingControl class, for a control that is defined in an .ascx file.

BuildCachedControl(Control, String, String, Int32, String, String, String, BuildMethod)

使用在用户控件(.ascx 文件)中指定的参数生成一个 StaticPartialCachingControl 对象,并将其作为已分析的子对象添加到用作容器的服务器控件。Builds a StaticPartialCachingControl object with the parameters specified in the user control (.ascx file) and adds it as a parsed sub-object to the containing server control.

public:
 static void BuildCachedControl(System::Web::UI::Control ^ parent, System::String ^ ctrlID, System::String ^ guid, int duration, System::String ^ varyByParams, System::String ^ varyByControls, System::String ^ varyByCustom, System::Web::UI::BuildMethod ^ buildMethod);
public static void BuildCachedControl (System.Web.UI.Control parent, string ctrlID, string guid, int duration, string varyByParams, string varyByControls, string varyByCustom, System.Web.UI.BuildMethod buildMethod);
static member BuildCachedControl : System.Web.UI.Control * string * string * int * string * string * string * System.Web.UI.BuildMethod -> unit
Public Shared Sub BuildCachedControl (parent As Control, ctrlID As String, guid As String, duration As Integer, varyByParams As String, varyByControls As String, varyByCustom As String, buildMethod As BuildMethod)

参数

parent
Control

要包含 StaticPartialCachingControl 实例的服务器控件。The server control to contain the StaticPartialCachingControl instance.

ctrlID
String

ASP.NET 为控件分配的标识符。The identifier assigned to the control by ASP.NET.

guid
String

缓存控件的全局唯一标识符。The globally unique identifier for the cached control.

duration
Int32

对控件的输出进行缓存的时间长度。The length of time the control's output is cached.

varyByParams
String

查询字符串或窗体 POST 参数字符串,用于区分缓存中的服务器控件。A string of the query string or form POST parameters by which to vary the server control in the cache.

varyByControls
String

一个字符串,列出了用以区别缓存中的用户控件的服务器控件属性。A string that lists the server-control properties by which to vary the user control in the cache.

varyByCustom
String

含有自定义输出缓存参数值的用户定义的字符串。A user-defined string that contains custom output-cache parameter values.

buildMethod
BuildMethod

可调用方法生成控件的委托。A delegate that calls the method to build the control.

注解

BuildCachedControl方法生成一个缓存控件,该控件与 Microsoft SQL Server 数据库表没有关系。The BuildCachedControl method builds a cached control with no relationship to a Microsoft SQL Server database table.

BuildCachedControl方法旨在供 ASP.NET 页框架使用,不应由开发人员直接调用。The BuildCachedControl method is intended for use by the ASP.NET page framework and should not be called directly by developers.

另请参阅

适用于

BuildCachedControl(Control, String, String, Int32, String, String, String, String, BuildMethod)

使用在用户控件(.ascx 文件)中指定的参数生成一个 StaticPartialCachingControl 对象,并将其作为已分析的子对象添加到用作容器的服务器控件。Builds a StaticPartialCachingControl object with the parameters specified in the user control (.ascx file) and adds it as a parsed sub-object to the containing server control.

public:
 static void BuildCachedControl(System::Web::UI::Control ^ parent, System::String ^ ctrlID, System::String ^ guid, int duration, System::String ^ varyByParams, System::String ^ varyByControls, System::String ^ varyByCustom, System::String ^ sqlDependency, System::Web::UI::BuildMethod ^ buildMethod);
public static void BuildCachedControl (System.Web.UI.Control parent, string ctrlID, string guid, int duration, string varyByParams, string varyByControls, string varyByCustom, string sqlDependency, System.Web.UI.BuildMethod buildMethod);
static member BuildCachedControl : System.Web.UI.Control * string * string * int * string * string * string * string * System.Web.UI.BuildMethod -> unit
Public Shared Sub BuildCachedControl (parent As Control, ctrlID As String, guid As String, duration As Integer, varyByParams As String, varyByControls As String, varyByCustom As String, sqlDependency As String, buildMethod As BuildMethod)

参数

parent
Control

要包含 StaticPartialCachingControl 实例的服务器控件。The server control to contain the StaticPartialCachingControl instance.

ctrlID
String

ASP.NET 为控件分配的标识符。The identifier assigned to the control by ASP.NET.

guid
String

缓存控件的全局唯一标识符。The globally unique identifier for the cached control.

duration
Int32

对控件的输出进行缓存的时间长度。The length of time the control's output is cached.

varyByParams
String

查询字符串或窗体 POST 参数字符串,用于区分缓存中的服务器控件。A string of the query string or form POST parameters by which to vary the server control in the cache.

varyByControls
String

一个字符串,列出了用以区别缓存中的用户控件的服务器控件属性。A string that lists the server-control properties by which to vary the user control in the cache.

varyByCustom
String

含有自定义输出缓存参数值的用户定义的字符串。A user-defined string that contains custom output-cache parameter values.

sqlDependency
String

由分号分隔的字符串,指定用于 Microsoft SQL Server 缓存依赖项的数据库和表。A semicolon-delimited string that specifies which databases and tables to use for the Microsoft SQL Server cache dependency.

buildMethod
BuildMethod

可调用方法生成控件的委托。A delegate that calls the method to build the control.

注解

BuildCachedControl方法使用与参数指定的 SQL Server 数据库表之间的关系生成缓存控件 sqlDependencyThe BuildCachedControl method builds a cached control with a relationship to a SQL Server database table specified by the sqlDependency parameter.

StaticPartialCachingControl方法旨在供 ASP.NET 页框架使用,不应由开发人员直接调用。The StaticPartialCachingControl method is intended for use by the ASP.NET page framework and should not be called directly by developers.

另请参阅

适用于

BuildCachedControl(Control, String, String, Int32, String, String, String, String, BuildMethod, String)

为 .ascx 文件中定义的控件生成 StaticPartialCachingControl 类的新实例。Builds a new instance of the StaticPartialCachingControl class, for a control that is defined in an .ascx file.

public:
 static void BuildCachedControl(System::Web::UI::Control ^ parent, System::String ^ ctrlID, System::String ^ guid, int duration, System::String ^ varyByParams, System::String ^ varyByControls, System::String ^ varyByCustom, System::String ^ sqlDependency, System::Web::UI::BuildMethod ^ buildMethod, System::String ^ providerName);
public static void BuildCachedControl (System.Web.UI.Control parent, string ctrlID, string guid, int duration, string varyByParams, string varyByControls, string varyByCustom, string sqlDependency, System.Web.UI.BuildMethod buildMethod, string providerName);
static member BuildCachedControl : System.Web.UI.Control * string * string * int * string * string * string * string * System.Web.UI.BuildMethod * string -> unit
Public Shared Sub BuildCachedControl (parent As Control, ctrlID As String, guid As String, duration As Integer, varyByParams As String, varyByControls As String, varyByCustom As String, sqlDependency As String, buildMethod As BuildMethod, providerName As String)

参数

parent
Control

服务器控件,用作 StaticPartialCachingControl 实例的容器。The server control that is used as the container for the StaticPartialCachingControl instance.

ctrlID
String

ASP.NET 向控件分配的 ID。The ID that is assigned to the control by ASP.NET.

guid
String

缓存控件的全局唯一标识符 (GUID)。The globally unique identifier (GUID) for the cached control.

duration
Int32

对控件的输出进行缓存的时间长度。The length of time that the control's output is cached.

varyByParams
String

查询字符串或窗体 POST 参数字符串,用以区分缓存中的用户控件。A string of the query string or form POST parameters by which to vary the user control in the cache.

varyByControls
String

一个字符串,列出了用以区别缓存中的用户控件的服务器控件属性。A string that lists the server-control properties by which to vary the user control in the cache.

varyByCustom
String

含有自定义输出缓存参数值的用户定义的字符串。A user-defined string that contains custom output-cache parameter values.

sqlDependency
String

由分号分隔的字符串,指定用于 Microsoft SQL Server 缓存依赖项的数据库和表。A semicolon-delimited string that specifies which databases and tables to use for the Microsoft SQL Server cache dependency.

buildMethod
BuildMethod

调用控件生成方法的委托。A delegate that calls the method that builds the control.

providerName
String

用于存储输出缓存控件的提供程序的名称。The name of the provider that is used to store the output-cached control.

适用于