[英]Render control programmatically (using LoadControl) while adhering the page lifecycle
[英]LoadControl in a static scriptmethod does not adhere page lifecycle (Init event is not raised)
我正在使用從Javascript調用的ScriptMethod
。 在此方法內部,我嘗試使用LoadControl
以編程方式獲取控件。
我將此控件添加到當前的IHttpHandler
( HttpContext.Current.Handler
)中,該IHttpHandler
是Page
的實例,該實例也包含我的(靜態) ScriptMethod
。 在此實例中,我添加了使用LoadControl
加載的控件,但是從未引發控件的Init
事件。
在遵守頁面生命周期的同時,是否可以在ScriptMethod
使用LoadControl
?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.