PagesSection Class
Provides programmatic access to the section of the configuration file. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
System.Configuration::ConfigurationElement
System.Configuration::ConfigurationSection
System.Web.Configuration::PagesSection
| Name | Description | |
|---|---|---|
![]() | PagesSection() | This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the PagesSection class using default settings. |
| Name | Description | |
|---|---|---|
![]() | AsyncTimeout | Gets or sets a value indicating the number of seconds to wait for an asynchronous handler to complete during asynchronous page processing. |
![]() | AutoEventWireup | Gets or sets a value indicating whether events for ASP.NET pages are automatically connected to event-handling functions. |
![]() | Buffer | Gets or sets a value that specifies whether .aspx pages and .ascx controls use response buffering. |
![]() | ClientIDMode | Gets or sets the default algorithm that is used to generate a control's identifier. |
![]() | CompilationMode | Gets or sets a value that determines how .aspx pages and .ascx controls are compiled. |
![]() | ControlRenderingCompatibilityVersion | Gets or sets a value that specifies the ASP.NET version that any rendered HTML will be compatible with. |
![]() | Controls | Gets a collection of TagPrefixInfo objects. |
![]() | CurrentConfiguration | Gets a reference to the top-level Configuration instance that represents the configuration hierarchy that the current ConfigurationElement instance belongs to.(Inherited from ConfigurationElement.) |
![]() | ElementInformation | Gets an ElementInformation object that contains the non-customizable information and functionality of the ConfigurationElement object. (Inherited from ConfigurationElement.) |
![]() | ElementProperty | Gets the ConfigurationElementProperty object that represents the ConfigurationElement object itself.(Inherited from ConfigurationElement.) |
![]() | EnableEventValidation | Gets or sets a value that specifies whether event validation is enabled. |
![]() | EnableSessionState | Gets or sets a value that specifies whether the session state is enabled, disabled, or read-only. |
![]() | EnableViewState | Gets or sets a value indicating whether view state is enabled or disabled. |
![]() | EnableViewStateMac | Gets or sets a value that specifies whether ASP.NET should run a message authentication code (MAC) on the page's view state when the page is posted back from the client. |
![]() | IgnoreDeviceFilters | Gets the collection of device tags that ASP.NET should ignore when it renders a page. |
![]() | Item[ConfigurationProperty^] | Gets or sets a property or attribute of this configuration element.(Inherited from ConfigurationElement.) |
![]() | Item[String^] | Gets or sets a property, attribute, or child element of this configuration element.(Inherited from ConfigurationElement.) |
![]() | LockAllAttributesExcept | Gets the collection of locked attributes.(Inherited from ConfigurationElement.) |
![]() | LockAllElementsExcept | Gets the collection of locked elements.(Inherited from ConfigurationElement.) |
![]() | LockAttributes | Gets the collection of locked attributes (Inherited from ConfigurationElement.) |
![]() | LockElements | Gets the collection of locked elements.(Inherited from ConfigurationElement.) |
![]() | LockItem | Gets or sets a value indicating whether the element is locked.(Inherited from ConfigurationElement.) |
![]() | MaintainScrollPositionOnPostBack | Gets or sets a value indicating whether the page scroll position should be maintained upon returning from a postback from the server. |
![]() | MasterPageFile | Gets or sets a reference to the master page for the application. |
![]() | MaxPageStateFieldLength | Gets or sets the maximum number of characters that a single view-state field can contain. |
![]() | Namespaces | Gets a collection of NamespaceInfo objects. |
![]() | PageBaseType | Gets or sets a value that specifies a code-behind class that .aspx pages inherit by default. |
![]() | PageParserFilterType | Gets or sets a value that specifies the parser filter type. |
![]() | Properties | Gets the collection of properties.(Inherited from ConfigurationElement.) |
![]() | RenderAllHiddenFieldsAtTopOfForm | Gets or sets a value that indicates whether all system-generated hidden fields are rendered at the top of the form. |
![]() | SectionInformation | Gets a SectionInformation object that contains the non-customizable information and functionality of the ConfigurationSection object. (Inherited from ConfigurationSection.) |
![]() | SmartNavigation | Gets or sets a value that indicates whether smart navigation is enabled. |
![]() | StyleSheetTheme | Gets or sets the name of an ASP.NET style sheet theme. |
![]() | TagMapping | Gets a collection of TagMapInfo objects. |
![]() | Theme | Gets or sets the name of an ASP.NET page theme. |
![]() | UserControlBaseType | Gets or sets a value that specifies a code-behind class that user controls inherit by default. |
![]() | ValidateRequest | Gets or sets a value that determines whether ASP.NET examines input from the browser for dangerous values. For more information, see Script Exploits Overview. |
![]() | ViewStateEncryptionMode | Gets or sets the encryption mode that ASP.NET uses when maintaining ViewState values. |
| Name | Description | |
|---|---|---|
![]() | DeserializeElement(XmlReader^, Boolean) | Reads XML from the configuration file.(Inherited from ConfigurationElement.) |
![]() | DeserializeSection(XmlReader^) | This API supports the product infrastructure and is not intended to be used directly from your code. Reads XML from the configuration file.(Inherited from ConfigurationSection.) |
![]() | Equals(Object^) | Compares the current ConfigurationElement instance to the specified object.(Inherited from ConfigurationElement.) |
![]() | GetHashCode() | Gets a unique value representing the current ConfigurationElement instance.(Inherited from ConfigurationElement.) |
![]() | GetRuntimeObject() | Returns a custom object when overridden in a derived class.(Inherited from ConfigurationSection.) |
![]() | GetType() | |
![]() | Init() | Sets the ConfigurationElement object to its initial state.(Inherited from ConfigurationElement.) |
![]() | InitializeDefault() | Used to initialize a default set of values for the ConfigurationElement object.(Inherited from ConfigurationElement.) |
![]() | IsModified() | Indicates whether this configuration element has been modified since it was last saved or loaded when implemented in a derived class.(Inherited from ConfigurationSection.) |
![]() | IsReadOnly() | Gets a value indicating whether the ConfigurationElement object is read-only.(Inherited from ConfigurationElement.) |
![]() | Reset(ConfigurationElement^) | Resets the internal state of the ConfigurationElement object, including the locks and the properties collections.(Inherited from ConfigurationElement.) |
![]() | ResetModified() | Resets the value of the IsModified method to false when implemented in a derived class.(Inherited from ConfigurationSection.) |
![]() | SerializeElement(XmlWriter^, Boolean) | Writes the contents of this configuration element to the configuration file when implemented in a derived class.(Inherited from ConfigurationElement.) |
![]() | SerializeSection(ConfigurationElement^, String^, ConfigurationSaveMode) | This API supports the product infrastructure and is not intended to be used directly from your code. Creates an XML string containing an unmerged view of the ConfigurationSection object as a single section to write to a file.(Inherited from ConfigurationSection.) |
![]() | SerializeToXmlElement(XmlWriter^, String^) | Writes the outer tags of this configuration element to the configuration file when implemented in a derived class.(Inherited from ConfigurationElement.) |
![]() | SetReadOnly() | Sets the IsReadOnly property for the ConfigurationElement object and all subelements.(Inherited from ConfigurationElement.) |
![]() | ShouldSerializeElementInTargetVersion(ConfigurationElement^, String^, FrameworkName^) | Indicates whether the specified element should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.(Inherited from ConfigurationSection.) |
![]() | ShouldSerializePropertyInTargetVersion(ConfigurationProperty^, String^, FrameworkName^, ConfigurationElement^) | Indicates whether the specified property should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.(Inherited from ConfigurationSection.) |
![]() | ShouldSerializeSectionInTargetVersion(FrameworkName^) | Indicates whether the current ConfigurationSection instance should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.(Inherited from ConfigurationSection.) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
![]() | Unmerge(ConfigurationElement^, ConfigurationElement^, ConfigurationSaveMode) | Modifies the ConfigurationElement object to remove all values that should not be saved. (Inherited from ConfigurationElement.) |
The PagesSection class provides a way to programmatically access and modify the content of the configuration file section. This configuration section supports setting certain ASP.NET page and control directives globally for all pages and controls in the scope of the configuration file. This includes the @ Page directive, the @ Import directive through the Namespaces collection property, and the @ Register directive through the Controls collection property. It also provides support for mapping tag types to other tag types at run time through the TagMapping collection property.
Directives specify settings used by the page and user-control compilers when they process ASP.NET Web Forms page (.aspx) and user control (.ascx) files.
This example demonstrates how to specify values declaratively for several attributes of the pages section, which can also be accessed as members of the PagesSection class.
The following configuration file example shows how to specify values declaratively for the section.
<system.web>
<pages buffer="true"
enableSessionState="true"
enableViewState="true"
enableViewStateMac="true"
autoEventWireup="true"
validateRequest="true"
asyncTimeout="45"
maintainScrollPositionOnPostBack = "False"
viewStateEncryptionMode = "Auto">
<namespaces>
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.ComponentModel" />
<add namespace="System.Configuration" />
<add namespace="System.Web" />
</namespaces>
<controls>
<clear />
<remove tagPrefix="MyTags" />
<!—- Searches all linked assemblies for the namespace -->
<add tagPrefix="MyTags1" namespace=" MyNameSpace "/>
<!-- Uses a specified assembly -->
<add tagPrefix="MyTags2" namespace="MyNameSpace"
assembly="MyAssembly"/>
<!-- Uses the specified source for the user control -->
<add tagprefix="MyTags3" tagname="MyCtrl"
src="MyControl.ascx"/>
</controls>
<tagMapping>
<clear />
<add
tagTypeName=
"System.Web.UI.WebControls.WebParts.WebPartManager"
mappedTagTypeName=
"Microsoft.Sharepoint.WebPartPartManager,
MSPS.Web.dll, Version='2.0.0.0'"
/>
<remove tagTypeName="SomeOtherNS.Class, Assemblyname" />
</tagMapping>
</pages>
</system.web>
The following code example demonstrates how to use the PagesSection class.
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



