![](/img/trans.png)
[英]UpdatePanel not working in ascx control if is added on Page_Load
[英]Problems maintaining a custom control's (ascx) states between postbacks when loading said ascx control in page_load
這個問題被問了很多遍了。 看一下這個例子: 在驗證器上設置ControlToValidate
Viewstate是在頁面加載事件之前恢復的,因此需要在頁面加載事件之前加載動態控件並將其添加到頁面,否則動態控件的狀態將不會按您期望的那樣恢復。 而是在Init事件中執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.