controls disappearing from placeholder on postback
Posted on 2003-10-24
I have a page upon which I have to add controls at runtime. They are rows of textboxes and dropdownlists, which I name ctrl00...ctrl09 and ctrl10...ctrl19 per row where the first digit is the row and the seecond is the column.
I have used a two dimensional array to initailize the controls to textboxes or dropdownlists, but then I add the control to a placeholder, like this:
However I need the user to be able to select from a dropdown list and when they do this another dropdown list is repopulated.
for example accounts are linked to departments, so when a user selects a certain department in a row I want the account dropdown list in the same row to populate with the department specific accounts. I have set these controls postback property to true.
However I can't seem to get a hold of the controls to update them after the postback.
The place holder returns false for Response.Write(plcCodeLines.HasControls) on the postback.
I can get a hold of the selected values by using request.form("ctrl00")
What is going on?? When I use the trace, I can see the controls in the control tree and the in the form collection (after postback)
Anything to do with viewstate?? This is a server-side web app by the way