dude with web custom controls

Discussion in 'ASP .Net Web Controls' started by wong chian, Jan 22, 2004.

  1. wong chian

    wong chian Guest

    Hi,

    I have this easy piece of code:

    public class Box1:System.web.ui.webcontrols.webcontrol
    {
    protected Button mybutton;
    protected override void OnInit()
    {
    InitializeComponent();
    }
    private void InitializeComponent()
    {
    this.Controls.add(mybutton);
    }
    }
    public class Gereral_Control:System.web.ui.webcontrols.webcontrol
    {
    protected Box1 mybox1=new Box1();
    protected override void OnInit(EventArgs e)
    {
    InitializeComponent();
    }
    private void InitializeComponent()
    {
    this.Controls.add(mybox1)
    }
    }

    Take in count this piece of code, how could i make that: when i press the button (the button inside the webcontrol Box1) appears some textboxes and another button?(something like a form)

    Thanks in advance.
    Wong chian.
     
    wong chian, Jan 22, 2004
    #1
    1. Advertising

  2. Hi Wong,

    You want to write a composite custom control which requires to follow an existing pattern, like creating child controls in the CreateChildControls, implementing the marker INamingContainer interface, etc. Take a look at the docs and tutorials availables on 'composite' custom controls.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
     
    Victor Garcia Aprea [MVP], Jan 22, 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. Richard
    Replies:
    8
    Views:
    604
    Richard
    Feb 7, 2005
  2. Guttyguppy

    New xml dude needs help with xslt

    Guttyguppy, Sep 15, 2005, in forum: XML
    Replies:
    6
    Views:
    404
  3. Merrill & Michele

    Dude and Duden

    Merrill & Michele, Dec 10, 2004, in forum: C Programming
    Replies:
    6
    Views:
    405
    Merrill & Michele
    Dec 13, 2004
  4. Pistorius

    Hyperlink dude!!

    Pistorius, Dec 23, 2009, in forum: .NET
    Replies:
    1
    Views:
    341
    Pistorius
    Dec 23, 2009
  5. Josema

    Required Field Validator dude

    Josema, Feb 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    108
    Josema
    Feb 27, 2004
Loading...

Share This Page