无为清净楼资源网 Design By www.qnjia.com
写一个方法:
复制代码 代码如下:
private void DisplayAllControl(Control control, int step)
{
foreach (Control ctl in control.Controls)
{
string s = new string('-', step * 4) + ctl.GetType().Name + "〈" + ctl.ID + "〉";
Response.Write(s + "<br/>");
if (ctl.HasControls())
DisplayAllControl(ctl, step + 1);
}
}

调用:
DisplayAllControl(this.Page, 0);
执行该方法后,会在页面中分层输出所有控件的类型和ID值,即使是GridView、母版页、用户控件里的控件也不例外。
标签:
类型,ID

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com