Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Combining Two Controls, best way?

Reply
Thread Tools

Combining Two Controls, best way?

 
 
Andrew Backer
Guest
Posts: n/a
 
      07-14-2005
I have a working date picker, and I want to combine it at the control
level with a textbox and validator, so we can use
<my:datepickertextboxthingy/>

What is the best way to go about this? I am most concerned with access
to the textbox's properties, since this will function mostly as a
textbox with a mostly-inert object attached to it.

Right now I have subclassed TextBox, and am attempting to somehow
attach the other control to it so they both get rendered. In the end I
think I would like to be able to wrap them in more html (tables, span,
div, etc), so I think I will need a little more control. In the end I
need to be here :

<my:textbox CssClass="Fun" Columns="10" ..more textbox props.../>

Where should I instantiate the addtional controls? How should I handle
prerender (the date picker needs it)? What should I do in Render() to
make this happen...

I guess I am really trying to avoid writing properties that wrap *all*
of the textbox properties. Any good way to do this?

TIA,
- Andrew Backer

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      07-14-2005
I suggest you create a composite control.
Here are the details:
http://SteveOrr.net/articles/ComboBox.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Andrew Backer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I have a working date picker, and I want to combine it at the control
> level with a textbox and validator, so we can use
> <my:datepickertextboxthingy/>
>
> What is the best way to go about this? I am most concerned with access
> to the textbox's properties, since this will function mostly as a
> textbox with a mostly-inert object attached to it.
>
> Right now I have subclassed TextBox, and am attempting to somehow
> attach the other control to it so they both get rendered. In the end I
> think I would like to be able to wrap them in more html (tables, span,
> div, etc), so I think I will need a little more control. In the end I
> need to be here :
>
> <my:textbox CssClass="Fun" Columns="10" ..more textbox props.../>
>
> Where should I instantiate the addtional controls? How should I handle
> prerender (the date picker needs it)? What should I do in Render() to
> make this happen...
>
> I guess I am really trying to avoid writing properties that wrap *all*
> of the textbox properties. Any good way to do this?
>
> TIA,
> - Andrew Backer
>



 
Reply With Quote
 
 
 
 
Andrew Backer
Guest
Posts: n/a
 
      07-15-2005
So I have to go the composite way, eh? Oh well...

Are we sure that there is no way to inherit TextBox, thereby gaining
all it's fancy properties and methods, and *then* tacking on the
datepicker/checkbox/etc that I need?

Im going to go the composite way for now, but the other way would be
sooooooo nifty

Thanks for the article,
- Andrew Backer

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem combining two XMLs using XSLT Stefan XML 2 01-27-2006 01:07 PM
combining two EDF netlist in ISE williams VHDL 1 04-18-2005 08:59 PM
Combining Two Data Sources for one Data List Winterminute ASP .Net 0 12-03-2003 06:03 PM
Combining two tables into one Chuck XML 0 08-28-2003 05:32 PM
combining two documents chris XML 2 07-31-2003 11:22 AM



Advertisments