在c#中类似吗?
var e = document.getElementsByName("test")[0];
var HTML = e.innerHTML;
答案 0 :(得分:2)
递归FindControl方法:
private Control RecursiveControlFind(Control parent, string controlID)
{
Control child = parent.FindControl(controlID);
if (child == null)
{
if (parent.Controls.Count > 0)
{
foreach (Control nestedControl in parent.Controls)
{
child = RecursiveControlFind(nestedControl, controlID);
if (child != null)
break;
}
}
}
return child;
}
答案 1 :(得分:0)
Control.FindControl Method但它不是递归的。