I have this panel…
<asp:Panel ID="panSumarios" runat="server" style="border:0px solid red;width:100%" ViewStateMode="Enabled"></asp:Panel>
…inside a div associated to a ModalPopupExtender.
Then, on a button click, I add some controls (textboxes) dinamically to this panel. When I close (confirm) the ModalPopupExtender, I try to access this textboxes with no luck. They don’t exist. It seems they do not persist after postback (when I confirm ModalPopupExtender).
Any ideas?
Thanks in advance.
there are a few things going on here. the biggest is confusing html controls with webforms server controls. another factor, if the added controls are web forms server controls, is when the dynamic controls are added.
dynamic webforms server controls must be created in the Init event to be properly wired to viewstate. they must also be created on every request.