Groups | Blog | Home
all groups > c# > june 2006 >

c# : Custom web control with two TextBox inside a panel


Wilson
6/30/2006 8:34:02 PM
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);
}
}
Wilson
6/30/2006 9:31:02 PM
Solved. thanks all.

[quoted text, click to view]
AddThis Social Bookmark Button