asp.net.ph

PagesSection Class

System.Web.Configuration Namespace


.NET Framework version 2.0

Provides programmatic access to the pages section of a configuration file. This class cannot be inherited.

PagesSection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public PagesSection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public AsyncTimeout TimeSpan [ Get , Set ]
public AutoEventWireup Boolean [ Get , Set ]
public Buffer Boolean [ Get , Set ]
public ClientIDMode ClientIDMode [ Get , Set ]
public CompilationMode CompilationMode [ Get , Set ]
public ControlRenderingCompatibilityVersion Version [ Get , Set ]
public Controls TagPrefixCollection [ Get ]
public EnableEventValidation Boolean [ Get , Set ]
public EnableSessionState PagesEnableSessionState [ Get , Set ]
public EnableViewState Boolean [ Get , Set ]
public EnableViewStateMac Boolean [ Get , Set ]
public IgnoreDeviceFilters IgnoreDeviceFilterElementCollection [ Get ]
public MaintainScrollPositionOnPostBack Boolean [ Get , Set ]
public MasterPageFile String [ Get , Set ]
public MaxPageStateFieldLength Int32 [ Get , Set ]
public Namespaces NamespaceCollection [ Get ]
public PageBaseType String [ Get , Set ]
public PageParserFilterType String [ Get , Set ]
public RenderAllHiddenFieldsAtTopOfForm Boolean [ Get , Set ]
public SmartNavigation Boolean [ Get , Set ]
public StyleSheetTheme String [ Get , Set ]
public TagMapping TagMapCollection [ Get ]
public Theme String [ Get , Set ]
public UserControlBaseType String [ Get , Set ]
public ValidateRequest Boolean [ Get , Set ]
public ViewStateEncryptionMode ViewStateEncryptionMode [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
protected DeserializeSection ( XmlReader reader ) Void
protected SetReadOnly ( ) Void

Remarks

The PagesSection class provides a way to programmatically access and modify the pages section of a configuration file.

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 ( <%@ Page %> ), the Import directive ( <%@ Import %> ) via the Namespaces collection property, and the Register directive ( <%@ Register %> ) via the Controls collection property. It also provides support for mapping tag types to other tag types at run time via 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.

Example

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 pages 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>
See Also

ASP.NET Configuration   <pages> Section Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph