您的位置:首页 > 其它

RegisterStartupScript和RegisterClientScriptBlock的区别

2011-03-22 15:40 239 查看

RegisterStartupScript和RegisterClientScriptBlock的区别

RegisterStartupScript是将js代码插入到生成页面的尾端。

而RegisterClientScriptBlock是将js代码插入到 生成的隐藏代码和body中页面代码之前。如下

RegisterStartupScript生成的代码

<body>

<input ....隐藏代码>

<p>hello</p>

<script>js代码</script>

</body>

RegisterClientScriptBlock生成的代码

<body>

<input ....隐藏代码>

<script>js代码</script>

<p>hello</p>

</body>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐