First off all you'll have to add the unit, containing the webusercontrol to your uses clause.
The following code shows how you can add it:
procedure TWebForm1.AddWuControl;
var wu : TMyWebUserControl; begin wu := TMyWebUserControl(LoadControl('MyWebuserControl.ascx')); pnlTest.Controls.Add(wu); end; |
Quit simple isn't it?
I generally use this technique when a repeater gets to complicated. Justing looping a recordset (? Ok DataReader) and create controls on a specific panel.
No comments:
Post a Comment