gccwebmaster
05-20-2005, 10:22 AM
Greetings,
I'm developing a voting simulator that will need to display a dynamic # of voting rows (each row is another instance of New.Vote.ascx). I am attempting to build the controls dynamically in the code behind, but I am unable to set the properties of the control. Below is my pertinent code for the both the control and web form.
New.Vote.ascx.cs
//### properties
public string DirectorName = string.Empty;
public int VoteID = 0;
...
Vote.Simulator.aspx.cs
//### load user control
Control Vote = LoadControl("Controls/New.Vote.ascx");
TitlePanel.Controls.Add(Vote);
How can I access these two properties to dynamically set them in a loop?
Thanks in advance for any insight and suggestions.
I'm developing a voting simulator that will need to display a dynamic # of voting rows (each row is another instance of New.Vote.ascx). I am attempting to build the controls dynamically in the code behind, but I am unable to set the properties of the control. Below is my pertinent code for the both the control and web form.
New.Vote.ascx.cs
//### properties
public string DirectorName = string.Empty;
public int VoteID = 0;
...
Vote.Simulator.aspx.cs
//### load user control
Control Vote = LoadControl("Controls/New.Vote.ascx");
TitlePanel.Controls.Add(Vote);
How can I access these two properties to dynamically set them in a loop?
Thanks in advance for any insight and suggestions.