I have some trivial server controls, derived from various WebControls
(TextBox, DropDownList, etc). The server control wraps the web control and
its label in a number <div>, <span> and <label> elements, with appropriate
class or style to facilitate proper positioning within a form.
I would like to add asp.net validators to these controls inside the server
control -- I cannot add these outside, as the placement of the error message
would be improper.
My question is, can this be done while continuing the current inheritance of
my custom server controls from the asp.net controls such as TextBox, or
must I build a composite control, derived from
System.Web.UI.WebControls.WebControl, that incorporates the asp:TextBox and
the asp:xxxValidator as child controls?
If this can be done without creating a composite control, how can I do it?
Any help would be appreciated.
Ron Strong
John Saunders - 28 Dec 2004 19:33 GMT
>I have some trivial server controls, derived from various WebControls
> (TextBox, DropDownList, etc). The server control wraps the web control
[quoted text clipped - 16 lines]
>
> If this can be done without creating a composite control, how can I do it?
You will have to use a Composite Control, but there's no reason that the
control cannot continue to inherit from TextBox or whatever.
John Saunders