Custom web control with two TextBox inside a panel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Would you give me a idea how to create a web control with two Textbox ?

my code :

namespace com.index.web.components
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:WebCustomControl1
runat=server></{0}:WebCustomControl1>")]
public class WebCustomControl1 : WebControl
{
public TextBox textBox1
{
get
{
TextBox box = (TextBox)ViewState["textBox1"];
return box;
}

set
{
ViewState["textBox1"] = value;
}
}


public TextBox textBox2
{
get
{
TextBox box = (TextBox)ViewState["textBox2"];
return box;
}

set
{
ViewState["textBox2"] = value;
}
}

protected override void RenderContents(HtmlTextWriter output)
{
output.Write(textBox1);
output.Write(textBox2);
}
}
}
 
Back
Top