<PAGE> Class

The code-behind class for a page is derived from BaseApplicationPage class.

This class contains methods that can be modified and some methods that should not be modified.  The methods that can be modified are in a region called Section 1 while Section 2 methods should not be modified.

The name of the code-behind class is the same as the name of the page.  For example, a page named ShowCustomerTable.aspx will have a code-behind code-behind class called ShowCustomerTable.  Since the name of the page is used as the name of the class, all page names must be unique in the application regardless of where they are located.

The code-behind classes are created in the namespace’s UI sub-namespace you provide when creating the application.  For example, if your namespace is specified as MyApp, the code-behind class is created in MyApp.UI.

This class also performs the following:

Example

A variable and public property is defined to access the control.

Protected WithEvents AuthorLastName As BaseClasses.Web.UI.WebControls.FieldValueTextBox

 

Public ReadOnly Property AuthorLastName() As BaseClasses.Web.UI.WebControls.FieldValueTextBox

    Get

        Return Me.AuthorLastName

    End Get

End Property

Protected WithEvents Declarations

Protected WithEvents declarations allow event handler methods to be associated with the declared server controls' server-side events.  These associations are established by using the Handles keyword and the declared WithEvents variable in the declaration(s) of eligible methods.

All ASP.NET controls in an ASPX page or ASCX control have a "Protected WithEvents" declaration in the code-behind, except ASP.NET controls contained inside of a templated server control's start and end tags declared in the same ASPX page or ASCX control.

See Also

Application Class Hierarchy