Reputation: 411
I would like to create a single control containing a TextBox and a Button but I have never created a custom control before and I am not sure how to do it, this is what I have done :
namespace CustomControls
{
public partial class TBP : TextBox
{
protected void Page_Load(object sender, EventArgs e)
{
}
public TBP()
{
this.Controls.Add(_Button);
}
private Button _Button = new Button();
}
}
Upvotes: 0
Views: 210
Reputation: 1656
Take a look on this 3 articles and you will be able to work with Controls due to your request.
Upvotes: 1