DropdownList & Textbox

Discussion in 'ASP .Net Building Controls' started by Martin Venter, Dec 6, 2004.

  1. Hi Everyone,



    I want too write a custom control involving a DropDownList and a TextBox.

    Basically I sometimes want to render a dropdownlist and sometimes a textbox
    but never both at the same time.



    The custom control needs to have all the properties and events of both
    individual controls and handle autopostback and viewstate.



    The question is from which control I should inherit from and what else I
    need to do to make this work.



    So far I've decided to inherit from dropdownlist until anyone tells me
    better and I've added a DisplayMode property which can be DropDownList or
    TextBox.



    Any help would be appreciated.



    Regards,

    Martin
    Martin Venter, Dec 6, 2004
    #1
    1. Advertising

  2. Please check this articule. Is in spanish, but i hope can help you. (You can
    download the code and try it)
    Is a control that do some like you search.
    http://www.microsoft.com/spanish/msdn/comunidad/mtj.net/voices/art177.asp

    --
    Saludos,
    Eugenio Serrano
    NDSoft Consultoria y Desarrollo
    MS MVP ASP.Net
    Voluntario Ineta Latam (www.ineta.org/latam)



    "Martin Venter" <> escribió en el mensaje
    news:...
    > Hi Everyone,
    >
    >
    >
    > I want too write a custom control involving a DropDownList and a TextBox.
    >
    > Basically I sometimes want to render a dropdownlist and sometimes a

    textbox
    > but never both at the same time.
    >
    >
    >
    > The custom control needs to have all the properties and events of both
    > individual controls and handle autopostback and viewstate.
    >
    >
    >
    > The question is from which control I should inherit from and what else I
    > need to do to make this work.
    >
    >
    >
    > So far I've decided to inherit from dropdownlist until anyone tells me
    > better and I've added a DisplayMode property which can be DropDownList or
    > TextBox.
    >
    >
    >
    > Any help would be appreciated.
    >
    >
    >
    > Regards,
    >
    > Martin
    >
    >
    Eugenio Serrano, Dec 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    492
    S. Justin Gengo
    Jul 16, 2003
  2. Hazzard
    Replies:
    2
    Views:
    529
    Yan-Hong Huang[MSFT]
    Jul 23, 2003
  3. Natty Gur
    Replies:
    0
    Views:
    444
    Natty Gur
    Jul 22, 2003
  4. =?Utf-8?B?Q2hyaXM=?=
    Replies:
    3
    Views:
    13,732
    Peter Blum
    Mar 30, 2005
  5. Jay

    Rich TextBox / HTML TextBox

    Jay, Apr 28, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    15,658
    Steve C. Orr [MVP, MCSD]
    Apr 29, 2005
Loading...

Share This Page