Share via


PagesSection.Buffer 属性

定义

获取或设置一个值,该值指定 .aspx 页和 .ascx 控件是否使用响应缓冲。

public:
 property bool Buffer { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("buffer", DefaultValue=true)]
public bool Buffer { get; set; }
[<System.Configuration.ConfigurationProperty("buffer", DefaultValue=true)>]
member this.Buffer : bool with get, set
Public Property Buffer As Boolean

属性值

如果 .aspx 页和 .ascx 控件使用响应缓冲,则为 true;否则为 false。 默认值为 true

属性

示例

下面的代码示例说明如何使用 Buffer 属性。

// Get the current Buffer property value.
Console.WriteLine(
    "Current Buffer value: '{0}'", pagesSection.Buffer);

// Set the Buffer property to true.
pagesSection.Buffer = true;
' Get the current Buffer property value.
Console.WriteLine( _
    "Current Buffer value: '{0}'", pagesSection.Buffer)

' Set the Buffer property to true.
pagesSection.Buffer = True

注解

打开响应缓冲后,将缓冲页或控件输出,直到处理整个页或控件之后。 如果性能是关键考虑因素,请不要将 设置为 Buffertrue

适用于