ServerTextBox V1.0 F1.7

File Name: Server_TextBox.asp
Class Name: ServerTextBox.asp
Overview
The ServerTextBox class is used display a text box to capture user input. This class supports various types of textboxes (see Mode property).



Public Constructors
New_ServerTextBox(id) This constructor is used to create an instance of the control while at the same time assiging it a name and id. It uses the default Mode (1).
New_ServerDateTextBox(id) This constructor is used to create an instance of the control while at the same time assiging it a name and id. It uses the Mode =  8 to create a date textbox.
New_ServerTextArea(name,cols,rows) This constructor is used to create an instance of the control while at the same time assiging it a name and id. It uses the Mode =  3 to create a text area.
New_ServerTextBoxEX(id,size,width) This constructor is used to create an instance of the control while at the same time assiging it a name and id. It allows to set the size and width at the same time.
New This is the default constructor and it will create an instance of the control without a name. Controls instanciated this way must assign the name of the control manually by doing this: <controlVariable>.Control.Name = "<ControlName>".

Public Properties
Control WebControl Inherits attributes from the WebControl class.
Text String Sets/Gets the contents of the texbox.
Caption String Sets/Gets the caption of the textbox. It renders to the left of the textbox.
Mode Int 1 Text, 2 Password, 3 TextArea, 4 Label, 5 Upper, 6 Lower, 7 Numeric, 8 Date
FormatString String RegEx used on the client side used to format the contents of the textbox.
Size Int Sets/Gets the width of the text box in characters.
MaxLength Int Sets/Gets the maximum number of characters that can be entered into the textbox.
ReadOnly Boolean Set/Sets a value to indicate wether or not the user can enter data in the texbox.
Rows Int Set/Sets a value to indicate the number of rows of the text area.
Cols Int Set/Sets a value to indicate the number of columns of the text area.
TextChanged Boolean Gets a value that indicates wether or not the contents of the texbox changed after a postback.
RaiseOnChanged Boolean Gets/Sets a value to indicate wether or not the user wants to be notified if the contents of the textbox changed during a postback. The event to be raised is ControlName_OnChanged(Control,Params)
AutoPostBack Boolean If true, then a postback will ocurr if the user changes the contents of the textbox in the browser.

Public Methods
(default) Render Renders the control to the page.
SetValueFromDataSource This method is used by the Page object when binding the whole page to a DataSource. In order for this to work, you need to se the DataTextField of the Control property. i.e. chkYesNo.Control.DataTextField = "SelectYN"

Public Events
OnChanged (Control,Params) This event is triggered if the contents of the TextBox changed. Control is the textbox and Params is not being used.

Protected Properties
-- -- --

Protected Methods
WriteProperties(bag) Invoked by the CLASP Framework to allow the control to restore its state after a postback. Bag is of type PropertyBag and can be used to read (or write) to the control viewstate.
ReadPropertied(bag) Invoked by the CLASP Framework to allow the control to persist its state before the page is destroyed. Bag is of type PropertyBag and can be used to read (or write) to the control viewstate.
RenderTextBox Renders the control as a TextBox (normal, numeric, lowercase and uppercase)
RenderLabel Renders the control as a Label
RenderTextArea Renders the control as a TextArea
RenderDateTextBox Renders the control as a Date TextBox.

Protected Events
HandleClientEvent Invoked by the CLASP Framework to allow the control to handle the postback event. From here the control can determine what is the course of action.