I am loading a usercontrol dynamically into a placeholder.
The problem is that my dropdownlist with autopostback in the usercontrol doesn't work the first time, only the second.
I found a post where the problem was resolved this way:
You problem is that you do not give you dynamically loaded control an
ID. So .Net gives your control it's own name, usually something like
_ctl2 or _ctl3. What is happening is that the name given to your
control is changing. If you explicitly define the ID, this won't
happen.
i.e. MyControl.ID = "MyControl"
I tried but it didnt work for me:
if not viewstate("action") = "myControl.ascx" then
phAction.Controls.Clear()
Dim uc as usercontrol = LoadControl("usercontrols/myControl.ascx ...
Go to the complete details ...