通用代码
public static ArrayList BtnList(SystemWebUIControl page)
{
int nPageControls = pageControlsCount;
ArrayList btnText = new ArrayList();
for (int i = ; i < nPageControls; i++)
{
foreach (SystemWebUIControl control in pageControls[i]Controls)
{
if (control is Button)
{
//btnTextAdd(controlID);
btnTextAdd((control as Button)Text);
}
}
}
return btnText;
}
页面调用代码
protected void Page_Load(object sender EventArgs e)
{
ArrayList arrayList = new ArrayList();
SystemWebUIPage page = (SystemWebUIPage)HttpContextCurrentHandler;
arrayList = BtnCtrListBtnList(page);
foreach (object o in arrayList)
{
ListBoxItemsAdd(oToString());
}
}