Adding ASP .NET Server controls on run time...
-
I was wondering a lot.. how to create ASP .NET Server controls on runtime without inserting them into ASPX file... check this article. http://support.microsoft.com/default.aspx?scid=kb;EN-US;317515#2 It tells how to add a Text Box on run time into webform though it does not have its entry in ASPX file. But the problem is: this text box has absolute location. Right? What if I want to place them in particular cell of table. Any idea? ------------------- Therez No Place like ... 127.0.0.1
-
I was wondering a lot.. how to create ASP .NET Server controls on runtime without inserting them into ASPX file... check this article. http://support.microsoft.com/default.aspx?scid=kb;EN-US;317515#2 It tells how to add a Text Box on run time into webform though it does not have its entry in ASPX file. But the problem is: this text box has absolute location. Right? What if I want to place them in particular cell of table. Any idea? ------------------- Therez No Place like ... 127.0.0.1
hi fadee, if you want to place TexBox in particular cell of table this is a one option: example in C#:
System.Web.UI.WebControls.Table myTable = new Table(); System.Web.UI.WebControls.TableRow myRow = new TableRow(); System.Web.UI.WebControls.TableCell myCell = new TableCell(); System.Web.UI.WebControls.TextBox myTextBox = new TextBox(); myTextBox.TextMode = TextBoxMode.SingleLine; myTextBox.Text = "Some text"; myCell.Controls.Add(myTextBox); myRow.Cells.Add(myCell); myTable.Rows.Add(myRow);
"A journey of a thousand miles must begin with a single step." -Chinese philosopher Lao Tzu