CHAN Reference
Chan Home | Reference Home | Event Firing Order | web.config
Controls.Control (base)
The Control control is an abstract class from which all Chan controls inherit. If you intend to build your own custom Chan compatible controls you will also need to use this as your base class and not System.Web.UI.Control.
| Qualifiers | Type | Name | Default | Description |
|---|---|---|---|---|
| string | id | "" | Unique identifier within the page for this control | |
| string | Class | "" | The CSS class of the output control, if used will be suffixxed to the Chan internal classnames | |
| string | Text | "" | The base text that can be sent and read back via postback, inherited controls should either (de)serialize through this or spawn hidden form controls to re-read. | |
| string | Size | "norm" | This presents a basic choice of three CSS defined control sizes, Thin, Norm(al) and Wide corresponding to .C__Thin, .C__Norm and .C__Wide in Controls.css. Inherited controls may have differing defaults for this. | |
| bool | Mandatory | false | Used by many controls for basic validation, a valid control usually has a Text property != String.Empty | |
| bool | Enabled | true | Wether or not the control is enabled within the page, usually directly mapped onto the HTML input disabled property. | |
| bool | Visible | true | Wether or not the control is rendered into the page's HTML. | |
| bool | IsValid | true | Wether or not the form contains valid or invalid items | |
| bool | NoScript | false | Usualy used for debugging and testing - allows or prevents the control from generating Javascript. Can be forced to true or false by the parent Page or the Site as a whole. |
| Qualifiers | Type | Name | Params | Description |
|---|---|---|---|---|
| Init | () | Called after Page_Init() for all controls | ||
| PostBack | ( string sPostBack ) | Called after Init() for each control found within any form POST data. | ||
| Validate | () | Called after PostBack if the form has AutoValidate set to true or the form was submitted by a button with ValidateForm set to true. | ||
| BeforePageLoad | () | Called before Page_Load() for all controls | ||
| AfterPageLoad | () | Called after Page_Load() for all controls | ||
| BeforePagePreRender | () | Called before Page_PreRender() for all controls | ||
| BeforeRender | () | Called before Render() for all controls - used to commit any changeable states to the parent Page/Form prior to final rendering. | ||
| Reset | Used by inherited controls to revert their state back to that specified in the raw ASPX, undoing any postback for example. | |||
| string | Tag_Open | () | Used to output the opening HTML tag, or for controls with no child controls the entire tag. | |
| string | Tag_Close | () | Used to output the closing HTML tag for the control, if any. | |
| string | Tag_Invisible | () | Used to output any placeholder HTML that the control may need to record state across postbacks when invisible. | |
| string | Tag_Contents | () | Handy function for extracting the ASPX markup within a controls original tag pair | |
| Invalidate | ( string sReason ) | Used to flag a control as invalid, this is not persisted across postbacks | ||
| Render_Invalid_Icon | () | Usually called from Tag_Close() to show the exclamation mark next to a control that has invalid contents. |