In asp.Net 2.0 there are many attributes in the page tag itself. Each attribute has a special meaning to it. These attributes are defined in the page so that we can specify them for specific pages. Most of them are also defined globally so that we do not have define them in the page.
Here is a list of attributes of the Page Tag.
asyncTimeout – This is an optional attribute to define the timeout for the asynchronous handler during asynchronous processing of the page. The default value is 45 sec.
autoeventWireup – This is also an optional attribute that defines if the events in the page are automatically enabled. The default value is true. This means
if we define a Page_load(with same signature) method in the page class, the event will be automatically be attached with page load method.
buffer – defines if there will be response buffereing based on URL resource. The default value is true
Compilationmode – This attribute is defined for the asp.net compiler. It defines the compilation model for the page. The values can be Always (meaning page should be compiled every time), Auto (meaning) compiler should not compile the page if possible and never (meaning that the page should never be compiled).
EnableEventValidation – defines if the page controls will be validated in the postback /callback or not.
EnableSessionState - defines the usages of session in the page. Default value is true. Other possible values are false (session will not be saved) and read only (session values can only be read but not written to).
EnableViewState – As the name suggest the tag specifies if the view state will be enabled for the page.
EnableViewStateMac – checks for the authentication of the viewstate. The check is made to check if the viewstate has been tampered on the client side. The default value is true.
MaintainscrollPositiononPostback - Maintains the position of the scroll during post back. The default value is false.
MasterPageFile – Is used to define the master Page for the page (if any).
MaxPageStateFieldLength – This is another optional attribute which takes and int32 type parameter. The attribute is used to define max length of character for the state field of the page. When set to a positive number, the viewstate of the page is broken into many numbers with a max character provided in the field. If the value is a negative number that the viewstate is kept in one variable only. The default value is -1.
PageBaseType – Takes a string value defining the base type that will be used for the bage. The default is System.Web.UI.Page. The value gets overridden by the value in the inherits attribute in the standalone file.
PageParserFilterType - Specifies the type name of a filter that is used by the ASP.NET parser to determine whether an item is allowed in the page at parse time. The filter must derive from the PageParserFilter class.
smartNavigation – determines if the page is going to use smart navigation for IE browser (5.5+). When set to true, in the browser, Navigational flash is eliminated, scroll position is persisted, Element focus is persisted and the history of the browser only stores the last state of the page. The default value is false.
styleSheetTheme – defines the Theme to be used by the page. The theme defined in the attribute is used before the creation of controls.
Theme - Specifies the theme to be used for the page. The theme is applied after the creation of the control.
userControlbaseType – specifies the base type for controls to be used when the page is standalone.
ValidateRequest – Defines if Asp.Net will validate the request for potential dangerous data. Te default value is true.
ViewStateEncryptionMode – Defines the mode of encryption of the viewstate. The attribute will override any default value provided in the configuration value. Possible values are Always, Auto (Viewstate is only encrypted if a controls request for it) and Never. The default value is Auto.
No comments:
Post a Comment