Adding UC via Code

L

Larry R

I have a page that dynamically generates various controls and places
them on a page. One of the controls is a UserControl .

I have a static class that I use for creating TableRows, which I add
to a Table at run time. The other controls such as a DropDownList and
TextBox work, but I can't get the usercontrol to work.

No errors, just nothing in the page.

Any Ideas?

THanks!


public static TableRow
CreateDateRange(System.Web.UI.UserControl control )
{
TableRow row = new TableRow();
row.Cells.Add(new TableCell());
row.Cells[0].Controls.Add(control);
return row;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top