Custom Web Control Craziness
-
I want to create a custom control that has 3 text fields. How would I go about doing it this way.
protected override void Render(HtmlTextWriter output) { StringBuilder s = new StringBuilder(); //Note I realize the opening tag for the asp:TextBox is missing but it wouldn't show in the forum the other way. s.Append(""); s.Append(""); s.Append(""); s.Append(""); output.Write(s.ToString()); } In my .ascx I have the follow overloaded function.. My table layout is a lot more advanced involving custom images and tables within tables but I am using this an a simple example. Now usually this is done with something similar to what is below. But my table html code is just to complex to get into creating the table like this. How can I use my code above to create a table but then somehow render it as a control? `TextBox txtUsername; protected override void CreateChildControls() { table = new Table(); TableRow tr = new TableRow(); TableCell td; td = new TableCell(); txtUsername = new TextBox(); td.Controls.Add(txtUsername); tr.Controls.Add(td); }` Thanks for your help everyone. Steve Nelson asp:TextBox id=textbox1 runat=server> asp:TextBox id=textbox2 runAt=server> asp:TextBox id=textbox3 runAt=server>