this.PreviousPage.FindControl遇到MasterPage,如何查找控件?
2011-07-21 14:24
337 查看
1.先找到链接的页的母版页this.PreviousPage.Master
2.从母版页中findControl的ContentPlaceHolder对象
3.从这个ContentPlaceHolder对象中找到相应的控件对象
TextBox tb = (TextBox)PreviousPage.Master.FindControl("ContentPlaceHolder1").FindControl("TextBox1");Respone.ReDirect(url)后,从url页面中不会找previouspage
只能使用Server.transfer(url),与button ,imageButton的postbackurl,才能使用this.previouspage
2.从母版页中findControl的ContentPlaceHolder对象
3.从这个ContentPlaceHolder对象中找到相应的控件对象
TextBox tb = (TextBox)PreviousPage.Master.FindControl("ContentPlaceHolder1").FindControl("TextBox1");Respone.ReDirect(url)后,从url页面中不会找previouspage
只能使用Server.transfer(url),与button ,imageButton的postbackurl,才能使用this.previouspage
相关文章推荐
- 【转】当PreviousPage.FindControl遇到MasterPage,如何查找控件
- 当PreviousPage.FindControl遇到MasterPage,如何查找控件?
- PreviousPage.FindControl遇到MasterPage查找控件的方法
- PreviousPage.FindControl遇到MasterPage查找控件的方法
- 如何查找带母版页的控件 Master.Master.FindControl("")
- 解决使用MasterPage后,Page.FindControl方法找不到指定控件的问题
- 使用MasterPage后的this.FindControl()函数的问题
- 使用MasterPage后的this.FindControl()函数的问题
- 解决使用MasterPage后,Page.FindControl方法找不到指定控件的问题
- 解决使用MasterPage后,Page.FindControl方法找不到指定控件的问题
- Page.Master.FindControl?还是Page.FindControl?
- FindControl查找内容页上的某个控件
- 如何给MASTERPAGE上的控件赋值。
- asp.net中的跨页发送(利用PreviousPage.FindControl()方法取值)
- MasterPage下的FindControl
- 由Page.FindControl想到的Page控件树结构
- masterpage中服务器端控件命名规则和如何用控件名取得document中的对象,用js动态设置控件事件和属性
- 如何去掉TabControl控件默认添加的TabPage
- Master指令,Control指令,Register指令,PreviousPageType指令,MasterType指令
- 不同页面之间传递值(使用Page.PreviousPage.FindControl)