CHAN Reference

Chan Home | Reference Home | Event Firing Order | web.config

   

Events

The "events" are controlled from the page's own OnInit - rather than using .Net events, in order to process your own code override one of the virtual members. If you then inherit one of your own Page classes you will need to call base.Page_EventFunc() in the new child Page_EventFunc() to propogate the event "firing". This departure from .Net events is by design.

PostBack() is only invoked when a control recieves a postback from a posted form, the page PostedForm/IsPostBack parameters may also not be fully resolved at this point so any custom controls that you create should perform the minimum "input grabbing" needed at that stage and perform any logic upon that in their Validate() event.

Button.Click() is an Event, and should be assigned from Page_Init() using C# delegate syntax: btnSubmit.Click = this.Form_Submitted;

The following is a list of virtual members of each named base class in the order they are fired, from top to bottom.

Page Template Control (Notes)
Template_Init() For use in base page classes so that Page_Init doesn't get over-overloaded,
you use this to assign a template to your page.
Page_Init() Populate your DropDowns here prior to PostBack processing.
Init() Control.ParentSite, Control.ParentPage and Control.ParentForm available.
PostBack() Only if the control is named in the HTTP POST
Validate() Only if within the submitted form, depends on Site.AutoValidate and PostedButton.ValidateForm.
Page.IsPostBack,Page.PostedForm/ID and Page.PostedButton/ID are now available.
BeforePageLoad() AKA "After PostBack"
Click_BeforePageLoad Only the Controls.Button that submitted the form (if any)
Page_Load()
AfterPageLoad()
Click Only the Controls.Button that submitted the form (if any)
BeforePagePreRender()
Page_PreRender()
PreRender() Only if the Template is hooked up to the Page.Template pointer.