Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / December 2004

Tip: Looking for answers? Try searching our database.

Adding validator to simple server control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron Strong - 26 Dec 2004 06:27 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.