现在的位置: 首页 > 综合 > 正文

asp.net不刷新显示隐藏的办法(心得)

2012年02月14日 ⁄ 综合 ⁄ 共 326字 ⁄ 字号 评论关闭

这个方法的重点是要理解从asp.net到html的编译后各控件变成是什么
比如textbox类型 > text类型   label > span 类型
知道这样后就可以在在Page_load事件,添加如下代码:  
   
  this.CheckBox1.Attributes.Add("onclick","javascript:SelectAllCheck();");  

然后再html页面里面写javascript的脚本
这里主要通过样式来控制,如textbox为document.getElementById("id").style.display = "none"//或者block
而label就是直接'id'.style.display = "none"//或者block

【上篇】
【下篇】

抱歉!评论已关闭.