您的位置:首页 > Web前端 > JavaScript

UpdatePanel 加载后 调用Js脚本

2013-03-20 21:01 344 查看
在UpdatePanel更新时,改变其内控件的width。

这个改了好久。。。最后找到下面这篇文章,终于解决问题了。。。

Execute JavaScript when an UpdatePanel is updated

protected void upImg_Load(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(upImg,this.GetType(),"panelSize","panelSize();",true);
}
function panelSize() {
var panel = document.getElementById("<%= pl_Image.ClientID %>");
//var panel = document.getElementById("pl_Image");
panel.style.width = (document.getElementById("divPanel").offsetWidth - 3) + "px";
//alert(panel.style.width);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: