如何在子页面中获取母版页控件ID [英] How to get a master page control id in child page
本文介绍了如何在子页面中获取母版页控件ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如何在子页面中获取母版页控件ID.
谢谢
莫哈末wasif
Hi All,
How to get a master page control id in child page.
Thanks
Mohd. wasif
推荐答案
访问子页面母版页面链接按钮的示例
Example to access linkbutton of master page in Child page
((LinkButton)Master.FindControl("ContentPlaceHolder1").FindControl("lbtnSignUp")).Text = "Sign Up";
像这样,您可以访问子页面中的无光泽页面的任何控件
Like this you can access any control of maste page in child page
例如:
Eg:
((Label)Master.FindControl("ContentPlaceHolder1").FindControl("lbl")).Text = "Your Text";
使用我的代码在母版页中查找子控件
Hi,
Use my code for finding child control in master page
((Image)Master.FindControl("imgid")).ImageUrl="~/images/asd.jpg";
最好的
All the Best
这篇关于如何在子页面中获取母版页控件ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文