jcexited
01-04-2011, 09:50 AM
Hello,
I'm evaluating user controls (.ascx) to use them in a web I'm developing, and I have found that work different if they are static (placed in the .aspx at design time) or dynamic (loaded in a PlaceHolder or Panel in .aspx Page_Load()).
For example: inside the .ascx control I use a DropdownList (with AutoPostback), and I want update other data displayed in the control depending on the selected value in the dropdownlist. If the .ascx is static, after a postback, the selected value is available in the Page_Load() event of the control. However, if the .ascx is dynamic, the selected value is available in the Page_PreRender() event (in Page_Load() is available the previous value).
Is correct this behaviour? Is it possible to make the dynamic user controls work like static in terms of page events?
I don't know if I'm doing something wrong (or forgetting something).
Regards.
I'm evaluating user controls (.ascx) to use them in a web I'm developing, and I have found that work different if they are static (placed in the .aspx at design time) or dynamic (loaded in a PlaceHolder or Panel in .aspx Page_Load()).
For example: inside the .ascx control I use a DropdownList (with AutoPostback), and I want update other data displayed in the control depending on the selected value in the dropdownlist. If the .ascx is static, after a postback, the selected value is available in the Page_Load() event of the control. However, if the .ascx is dynamic, the selected value is available in the Page_PreRender() event (in Page_Load() is available the previous value).
Is correct this behaviour? Is it possible to make the dynamic user controls work like static in terms of page events?
I don't know if I'm doing something wrong (or forgetting something).
Regards.