The Page class must be the base class for any of your own ASPX code-behind
pages. It hooks into the native ASP.Net engine's Page_Init() event to kick
off it's own Event sequence and polices
the population of controls from postback and final HTML output.
The simplest Chan-driven site would probably need only one or two base Page
overloads, the Chan_Demo implimentation uses one called Page_Base to wire
up the Template which is then used as the base
HTML for all the pages in the demo site.
In order to allow multiple pages to use the same template the Page class
exposes a number of public properties which you can set from the Page
directive at the top of each ASPX page such as Page_Title. It also exposes
a simple pair of properties - Page_Scripts and Page_Styles - that allow
you to specify comma seperated lists of css and javascript files to include.
Roadmap
- Make PostedForm,PostedButton etc. readonly
- Convert other public members to properties and make the members protected internal
| Qualifiers |
Type |
Name |
Default |
Description |
|
string |
Page_Title |
"" |
Title of page, rendered into the Template [Page_Title] Region. Also combined with Site.Title depending on the value of Site.Page_Title_Position and endered into the Template [Title] Region |
|
string |
Page_Keywords |
"" |
Combined with Site.Keywords and rendered into the Template [Keywords] Region |
|
string |
Page_Description |
"" |
Combined with Site.Keywords and rendered into the Template [Description] Region |
|
string |
Page_Styles |
"" |
Comma-seperated list of virtual-paths to CSS stylesheets. the LINK HTML tags are automatically generated and inserted into the Template [Head] Region |
|
string |
|
"" |
|
|
string |
Page_Scripts |
"" |
Comma-seperated list of virtual-paths to Javascript source files. the SCRIPT HTML tags are automatically generated and inserted into the Template [Head] Region |
|
string |
Page_Head |
"" |
Allows any extra per-page tags to be manually inserted into the Tempalte [Head] Region |
|
ConfigBool |
Page_NoScript |
Unset |
Wether or not to Allow, Force or Deny controls in the page from generating Javascript, depending on the settings of Unset,True and False respectively. Will be superceeded by Site.NoScript if that is not set to Unset. |
| readonly |
Chan.Site |
ParentSite |
|
Handle to the Site object. |
| readonly |
Controls.Fragment |
Content |
|
Contains all the controls defined in the Page's ASPX file. The children of the Content Control are what is rendered into the Template [Content] Region |
|
bool |
IsPostBack |
false |
True if the current request is the result of a Chan.Form posting back |
|
Controls.Form |
PostedForm |
null |
If a Chan Form caused the page to post back then this will be a pointer to that form - but only if it exists in the Page's Control tree (including fragments loaded during Page_Init) |
|
string |
PostedFormID |
"" |
If a Chan Form caused the page to post back then this will be ID of the Chan Form that caused the postback to occur, even if PostedForm is null |
|
Controls.Button |
PostedButton |
null |
If a Chan Form caused the page to post back then this will be a pointer to the button the user clicked to cause the postback - but only if it exists in the Form' Control tree (including fragments loaded during Page_Init) |
|
string |
PostedButtonID |
"" |
If a Chan.Form caused the page to post back then this will be ID of the Chan Button that caused the postback to occur, even if PostedForm or PostedButton is null |
|
Template |
Template |
null |
When set the page will render itself through the given template, otherwise a basic fallback HTML 4 STRICT page structure will be output. To force raw output set this to a Template with a TemplateFile containing only a [Content] placeholder. |
|
Location |
Location |
(Current URL) |
This Location object is used to build Form Action links and has a writeable QueryString member, allowing you to propogate or alter the querystring that a form will post to, handy for pagination amongst other things. |
| Qualifiers |
Type |
Name |
Params |
Description |
| static |
Chan.Page |
CurrentContext |
() |
Wraps a call and cast to System.Web.HttpContext.Current.Handler. |
| virtual |
void |
Template_Init |
() |
Overridable Page Event that is fired first. See the About Events Page |
| virtual |
void |
Page_Init |
() |
Overridable Page Event that is fired before PostBack. See the About Events Page |
| virtual |
void |
Page_Load |
() |
Overridable Page Event that is fired after PostBack. See the About Events Page |
| virtual |
void |
Page_PreRender |
() |
Overridable Page Event that is fired last. See the About Events Page |