Can't get ScriptManager.RegisterStartupScript in WebControl nested in UpdatePanel to work

前端 未结 10 1288
不思量自难忘°
不思量自难忘° 2020-12-12 17:20

I am having what I believe should be a fairly simple problem, but for the life of me I cannot see my problem. The problem is related to ScriptManager.RegisterStartupScript,

10条回答
  •  情书的邮戳
    2020-12-12 17:49

    What worked for me, is registering it on the Page while specifying the type as that of the UpdatePanel, like so:

    ScriptManager.RegisterClientScriptBlock(this.Page, typeof(UpdatePanel) Guid.NewGuid().ToString(), myScript, true);
    

提交回复
热议问题