且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ClientScript.RegisterClientScriptBlock不工作

更新时间:2023-12-05 23:20:52

当您使用的RegisterClientScriptBlock JavaScript的code在页​​面年初插入,所以它会加载的内容之前运行。

When you use RegisterClientScriptBlock the Javascript code is inserted early in the page, so it will run before the elements are loaded.

使用的RegisterStartupScript 来代替,哪个地方code。在表单的结尾。

Use RegisterStartupScript instead, which places the code at the end of the form.