G
Guest
Hi,
This question is related with c# and ASP.NET, (I could't find the rigth
forum).
What I need to do is to add a usercontrol in a row of my table using the
server code (I know how to do it on the front-end). The idea is to show the
search results on the page, every entry is a usercontrol (obviously the same
loaded with different data). I have tried this but it does not work, any
ideas? (here is an example)
protected MyUserControl[] m_MyControls;
protected Table m_MyTable;
public void On_Load(...)
{
MyControls = new MyUserControl[2];
MyControls[0] = new MyUserControl();
MyControls[1] = new MyUserControl();
MyControl[0].Description = "Text1";
MyControl[1].Description = "Text2";
MyTable.Rows[0].Cells[0].Controls.Add(MyControl[0]);
MyTable.Rows[0].Cells[0].Controls.Add(MyControl[1]);
}
No errors are triggered, seems to be adding the controls but no ouput is
visible (none even using "View source").
Any Ideas?
Thanks
This question is related with c# and ASP.NET, (I could't find the rigth
forum).
What I need to do is to add a usercontrol in a row of my table using the
server code (I know how to do it on the front-end). The idea is to show the
search results on the page, every entry is a usercontrol (obviously the same
loaded with different data). I have tried this but it does not work, any
ideas? (here is an example)
protected MyUserControl[] m_MyControls;
protected Table m_MyTable;
public void On_Load(...)
{
MyControls = new MyUserControl[2];
MyControls[0] = new MyUserControl();
MyControls[1] = new MyUserControl();
MyControl[0].Description = "Text1";
MyControl[1].Description = "Text2";
MyTable.Rows[0].Cells[0].Controls.Add(MyControl[0]);
MyTable.Rows[0].Cells[0].Controls.Add(MyControl[1]);
}
No errors are triggered, seems to be adding the controls but no ouput is
visible (none even using "View source").
Any Ideas?
Thanks