dude with web custom controls

W

wong chian

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.
 
V

Victor Garcia Aprea [MVP]

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top