Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: web form control during run time


Message #1 by "bimalka" <bimalkaw@a...> on Thu, 15 Aug 2002 18:40:59
Hi

How can I create a web form control(eg a button) during runtime using
"code behind"

bimalka
Message #2 by "Curtner, Lynn" <lynn.curtner@p...> on Thu, 15 Aug 2002 13:02:51 -0500
I think basically you need some kind of container to put the control into.  With a Table, you can use code like the following...

TableRow MyTableRow = new TableRow();
MyTableCell = new TableCell();
MyTextBox = new TextBox();
MyTextBox.ID = "MyTextBox";
MyTableCell.Controls.Add(MyTextBox);
MyTableRow.Cells.Add(MyTableCell);
MyTable.Rows.Add(MyTableRow);

HTH,
Lynn Curtner

> ----------
> From: 	bimalka[SMTP:bimalkaw@a...]
> Reply To: 	aspx_beginners
> Sent: 	Thursday, August 15, 2002 1:40 PM
> To: 	aspx_beginners
> Subject: 	[aspx_beginners] web form control during run time
> 
> 
> Hi
> 
> How can I create a web form control(eg a button) during runtime using
> "code behind"
> 
> bimalka
> ---
> Beginning ASP.NET 1.0 with C#
> Entirely revised and updated for the final release, 
> provides a step-by-step introduction with plenty of 
> worked examples to help you to gain a deep understanding 
> of what ASP.NET is all about, and how you can harness it 
> to build powerful web applications. 
> http://www.wrox.com/acon11.asp?ISBN=1861007345
> 

  Return to Index