本文整理汇总了C#中System.Web.UI.WebControls.Table.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# Table.FindControl方法的具体用法?C# Table.FindControl怎么用?C# Table.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Table
的用法示例。
在下文中一共展示了Table.FindControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertTableToHtmlTable
private string ConvertTableToHtmlTable(Table originalTable, System.Web.UI.Control container, IDictionary persistMap)
{
IList list = new ArrayList();
foreach (System.Web.UI.Control control in originalTable.Controls)
{
list.Add(control);
}
Table child = new Table();
foreach (System.Web.UI.Control control2 in list)
{
child.Controls.Add(control2);
}
if (originalTable.ControlStyleCreated)
{
child.ApplyStyle(originalTable.ControlStyle);
}
child.Width = ((WebControl) base.ViewControl).Width;
child.Height = ((WebControl) base.ViewControl).Height;
if (container != null)
{
container.Controls.Add(child);
container.Controls.Remove(originalTable);
}
IDesignerHost service = (IDesignerHost) this.GetService(typeof(IDesignerHost));
if (persistMap != null)
{
foreach (string str in persistMap.Keys)
{
System.Web.UI.Control control3 = child.FindControl(str);
if ((control3 != null) && control3.Visible)
{
control3.ID = (string) persistMap[str];
LiteralControl control4 = new LiteralControl(ControlPersister.PersistControl(control3, service));
control3.Parent.Controls.Add(control4);
control3.Parent.Controls.Remove(control3);
}
}
}
foreach (string str3 in _persistedControlIDs)
{
System.Web.UI.Control control5 = child.FindControl(str3);
if (control5 != null)
{
if (Array.IndexOf<string>(_persistedIfNotVisibleControlIDs, str3) >= 0)
{
control5.Visible = true;
control5.Parent.Visible = true;
control5.Parent.Parent.Visible = true;
}
if (str3 == "ErrorMessage")
{
TableCell parent = (TableCell) control5.Parent;
parent.ForeColor = Color.Red;
parent.ApplyStyle(this._createUserWizard.ErrorMessageStyle);
control5.EnableViewState = false;
}
if (control5.Visible)
{
LiteralControl control6 = new LiteralControl(ControlPersister.PersistControl(control5, service));
control5.Parent.Controls.Add(control6);
control5.Parent.Controls.Remove(control5);
}
}
}
StringWriter writer = new StringWriter(CultureInfo.CurrentCulture);
HtmlTextWriter writer2 = new HtmlTextWriter(writer);
child.RenderControl(writer2);
return writer.ToString();
}