asp.net MasterPage FindControl
2008-05-14 12:13
309 查看
在ASP.NET 2.0 中如果使用了masterPage,则不能像未使用母版页时那样使用 FindControl,则需要使用先找到ContentPlaceHolder及其ID,然后再找在这个ContentPlaceHolder中的你要找的控件 System.Web.UI.Control oControl = this.Page.Master.FindControl("ContentPlaceHolder1").FindControl("TextBox1"); TextBox tb = (TextBox)oControl; tb.Text = "dddd";
相关文章推荐
- Asp.Net 2.0 开发加速之 - Ilungasoft.Helper.Web.UI.MasterPage/Page/UserControl 精装版
- ASP.NET的Page指令, Master指令,Control指令,Register指令,PreviousPageType指令,MasterType指令
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- asp.net 2.0中tablecontrol搭配masterpage的小bug
- asp.net从masterPage继承的页面,如何在客户端用javascript取control(比如textbox)的值
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- asp.net中的跨页发送(利用PreviousPage.FindControl()方法取值)
- asp.net 2.0中tablecontrol搭配masterpage的小bug
- asp.net 2.0中tablecontrol搭配masterpage的小bug
- ASP.NET 2.0 MasterPages and FindControl()
- ASP.NET中Master Page和Content Page里的事件处理顺序
- ASP.NET学习笔记[2] - 关于使用Master.Page的几点注意事项
- asp.net FindControl方法误区和解析
- 使用MasterPage后的this.FindControl()函数的问题
- Asp.Net MVC 2.0 动态加载Master Page数据(二)
- PreviousPage.FindControl遇到MasterPage查找控件的方法
- Asp.net 2.0专题之一:MasterPage
- Calling JavaScript from ASP.NET Master Page and Content Pages
- 【转】完美解决Asp.Net的MasterPage中添加JavaScript路径问题
- ASP.NET 2.0 之 Master Page 学习笔记