UpdatePanel和document.ready()Sys.Application.add_load没有添加处理程序
我希望我的div在HiddenFiled
值的基础上可见。 所以我做了以下事情:
ASPX
Sys.Application.add_load(BindEvents); Link Name : Url : Position : Show on same page :
和代码背后
protected void radAdd_CheckedChanged(Object sender, EventArgs e) { hfShow.Value = "1"; } protected void radEdit_CheckedChanged(Object sender, EventArgs e) { hfShow.Value = "1"; }
JAVASCRIPT
function BindEvents() { $(document).ready(function () { var hf = document.getElementById("hfShow"); alert(hf.value); if (hf.value == "1") { Popup.showModal('addPopUp', null, null, { 'screenColor': '#cccccc', 'screenOpacity': .6 }); } }); }
我无奈地发现为什么alert(hf.value);
背后的问题alert(hf.value);
不行,我猜Sys.Application.add_load(BindEvents);
不工作,任何人都知道为什么它不工作? 谢谢。