K
Kiki
Add user controls to programmatically specified location
I have some data about a control I'm calling from a page. This control
will be load n-th times on the page but only one option will be
displayed at any time. I would like to place these controls in divs
that I can then decide to display or hide according to user selection.
This is the code at the moment:
foreach (GameDetails gameAttributes in gameDetails)
{
Game gameControl = (Game) LoadControl("UserControls/Game.ascx");
gameControl.HRef = gameAttributes.HRef;
gameControl.Title = gameAttributes.Title;
this.phGameDetails.Controls.Add(gameControl);
}
Instead of placing the controls in phGameDetails, I would like to
specify a div and its id for each control that will potentially be
loaded.
I know i could get all the divs and then place the controls there as
they load but i won't know how many divs i'll need until run-time.
Can anyone help? Thank you for your time.
Kiki
I have some data about a control I'm calling from a page. This control
will be load n-th times on the page but only one option will be
displayed at any time. I would like to place these controls in divs
that I can then decide to display or hide according to user selection.
This is the code at the moment:
foreach (GameDetails gameAttributes in gameDetails)
{
Game gameControl = (Game) LoadControl("UserControls/Game.ascx");
gameControl.HRef = gameAttributes.HRef;
gameControl.Title = gameAttributes.Title;
this.phGameDetails.Controls.Add(gameControl);
}
Instead of placing the controls in phGameDetails, I would like to
specify a div and its id for each control that will potentially be
loaded.
I know i could get all the divs and then place the controls there as
they load but i won't know how many divs i'll need until run-time.
Can anyone help? Thank you for your time.
Kiki