當前位置: 首頁>>代碼示例>>C#>>正文


C# Table.FindControl方法代碼示例

本文整理匯總了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();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:69,代碼來源:CreateUserWizardDesigner.cs


注:本文中的System.Web.UI.WebControls.Table.FindControl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。