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

前端 未结 10 1293
不思量自难忘°
不思量自难忘° 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 18:00

    ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(),script,  true );
    

    The "true" param value at the end of the ScriptManager.RegisterStartupScript will add a JavaScript tag inside your page:

    
    

    If the value will be "false" it will inject only the script witout the --script-- tag.

提交回复
热议问题