在母版页中查找所有用户控件 [英] Find all user controls in master page
本文介绍了在母版页中查找所有用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在母版页的aspx页面中找到usercontrol列表?
Is there is any way to find the list of usercontrols in aspx page in a master page?
推荐答案
是的,有。您就是这样做的:
Yes, there is. This is how you do it:
foreach (Control ctrl in Page.Controls)
{
if (ctrl is UserControl)
{
//Do whatever you want.
}
}
这篇关于在母版页中查找所有用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文