开发者

Loading user controls dynamically

开发者 https://www.devze.com 2023-03-27 06:17 出处:网络
I have an aspx page and therein I have a dropdown control. Depending on the selected value, I need toload the user control that many times in the page. E.g..if first item is selected, I need to query

I have an aspx page and therein I have a dropdown control. Depending on the selected value, I need to load the user control that many times in the page. E.g..if first item is selected, I need to query DB and get how many subsections are their for this value and then load the user control that many times. It is working fine if I load the user controls in Page Load开发者_运维问答. However, If I want the view state to persist in these dynamically added user controls, I need to load them before load in Page_init event. However, when I try to do this in Page_Init, the viewstate for the dropdown has not been restored and I dont know how many usercontrols to load.

Any suggestions?.

0

精彩评论

暂无评论...
验证码 换一张
取 消