I am facing an issue with my ASP site where users can add Label elements. The problem is I am not able to track the labels that were added or their IDs. All I know is that they will be inside the Panel called pnl_Added. Once the user has finished adding labels, they click a Send button to update.
Now, on the server side, I am waiting for this postback but I am unsure how to determine which elements were added to pnl_Added and when to do so. Can anyone provide guidance?
I have attempted the following code:
protected void Page_Load(object sender, EventArgs e)
{
[...]
for (int i = 0; i < pnl_Added.Controls.Count; i++)
{
[...]
}
[...]
}
However, I suspect it may be too late due to the loaded ViewState. Could this be the reason?
I am using VS 2013, ASP C#, within the .Net Framework 4.