您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: