当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTable.FindControl方法代码示例

本文整理汇总了C#中System.Web.UI.HtmlControls.HtmlTable.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTable.FindControl方法的具体用法?C# HtmlTable.FindControl怎么用?C# HtmlTable.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.HtmlControls.HtmlTable的用法示例。


在下文中一共展示了HtmlTable.FindControl方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CopyData

 public static void CopyData(HtmlTable tblDetail,object outObj)
 {
     foreach (PropertyInfo i in outObj.GetType().GetProperties())
     {
         if (i.PropertyType.FullName.Equals(typeof(string).FullName) == true)
         {
             RadTextBox txt = tblDetail.FindControl(i.Name) as RadTextBox;
             if (txt == null)
             {
                 //thử với CodeList
                 CodeList cl = tblDetail.FindControl(i.Name) as CodeList;
                 if (cl == null) continue;
                 i.SetValue(outObj, cl.CODE, null);
                 continue;
             }
             else
             {
                 i.SetValue(outObj, txt.Text, null);
                 continue;
             }
         }
         if (i.PropertyType.FullName.Equals(typeof(decimal).FullName) == true)
         {
             RadNumericTextBox txt = tblDetail.FindControl(i.Name) as RadNumericTextBox;
             if (txt == null) continue;
             decimal dm = 0;
             if(decimal.TryParse(txt.Text,out dm)==true)
                 i.SetValue(outObj, dm, null);
         }
     }
 }
开发者ID:huamanhtuyen,项目名称:myWarehouse2,代码行数:31,代码来源:clsAll.cs

示例2: ClearDesignData

        public static void ClearDesignData(HtmlTable tblDetail,object obj)
        {
            foreach (PropertyInfo i in obj.GetType().GetProperties())
            {
                if (i.PropertyType.FullName.Equals(typeof(string).FullName) == true)
                {
                    RadTextBox txt = tblDetail.FindControl(i.Name) as RadTextBox;
                    if (txt == null) continue;
                    txt.Text = string.Empty;
                }

                if (i.PropertyType.FullName.Equals(typeof(decimal).FullName) == true)
                {
                    RadNumericTextBox txt = tblDetail.FindControl(i.Name) as RadNumericTextBox;
                    if (txt == null) continue;
                    txt.Text = string.Empty;
                }
            }
        }
开发者ID:huamanhtuyen,项目名称:myWarehouse2,代码行数:19,代码来源:clsAll.cs

示例3: FindTrByName

 private static HtmlTableRow FindTrByName(string controlName, HtmlTable tblABM)
 {
     if (tblABM.FindControl("tr" + controlName) != null && tblABM.FindControl("tr" + controlName) is HtmlTableRow)
         return (HtmlTableRow)tblABM.FindControl("tr" + controlName);
     else
         return null;
 }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:7,代码来源:FormsHelper.cs

示例4: FindTdByName

 private static HtmlTableCell FindTdByName(string controlName, HtmlTable tblABM)
 {
     if (tblABM.FindControl("td" + controlName) != null && tblABM.FindControl("td" + controlName) is HtmlTableCell)
         return (HtmlTableCell)tblABM.FindControl("td" + controlName);
     else
         return null;
 }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:7,代码来源:FormsHelper.cs

示例5: FindControlByName

 private static Control FindControlByName(string controlName, HtmlTable tblABM)
 {
     if (tblABM.FindControl(controlName) != null && tblABM.FindControl(controlName) is Control)
         return (Control)tblABM.FindControl(controlName);
     else
         return null;
 }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:7,代码来源:FormsHelper.cs

示例6: FindComboBoxByName

 private static ucComboBox FindComboBoxByName(string controlName, HtmlTable tblABM)
 {
     if (tblABM.FindControl("uc" + controlName) != null && tblABM.FindControl("uc" + controlName) is ucComboBox)
         return (ucComboBox)tblABM.FindControl("uc" + controlName);
     else
         return null;
 }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:7,代码来源:FormsHelper.cs

示例7: AppendEditViewFieldsReadOnly


//.........这里部分代码省略.........
				{
					if ( !Sql.IsEmptyString(sDATA_FIELD) )
					{
						Label litField = new Label();
						tdField.Controls.Add(litField);
						// 07/25/2006   Align label values to the middle so the line-up with the label. 
						tdField.VAlign = "middle";
						litField.ID = sDATA_FIELD + sIDSuffix;
						try
						{
							if ( sDATA_FIELD.IndexOf(".") >= 0 )
								litField.Text = L10n.Term(sDATA_FIELD);
							else if ( rdr != null )
								litField.Text = Sql.ToString(rdr[sDATA_FIELD]);
						}
						catch(Exception ex)
						{
							SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex);
							litField.Text = ex.Message;
						}
					}
				}
				else if ( String.Compare(sFIELD_TYPE, "ListBox", true) == 0 )
				{
					if ( !Sql.IsEmptyString(sDATA_FIELD) )
					{
						Label lstField = new Label();
						tdField.Controls.Add(lstField);
						lstField.ID   = sDATA_FIELD + sIDSuffix;
						try
						{
							if ( rdr != null )
							{
								Control ctlPrimary = tbl.FindControl(sDATA_FIELD);
								if ( ctlPrimary != null )
									btnCopyField.OnClientClick = "return CopyListField('" + ctlPrimary.ClientID + "', '" + lstField.ClientID + "');";
								
								string sListValue = Sql.ToString(rdr[sDATA_FIELD]);
								if ( !Sql.IsEmptyString(sListValue) )
								{
									bool bCustomCache = false;
									lstField.Text = SplendidCache.CustomList(sCACHE_NAME, sListValue, ref bCustomCache);
									if ( bCustomCache )
										continue;
									// 02/12/2008   If the list contains XML, then treat as a multi-selection. 
									if ( sListValue.StartsWith("<?xml") )
									{
										StringBuilder sb = new StringBuilder();
										StringBuilder sbArray = new StringBuilder();
										XmlDocument xml = new XmlDocument();
										xml.LoadXml(sListValue);
										XmlNodeList nlValues = xml.DocumentElement.SelectNodes("Value");
										foreach ( XmlNode xValue in nlValues )
										{
											if ( sb.Length > 0 )
											{
												sb.Append(", ");
												sbArray.Append(", ");
											}
											string sTermValue = Sql.ToString(L10n.Term("." + sCACHE_NAME + ".", xValue.InnerText));
											sb.Append(sTermValue);
											// 08/01/2010   The array should use the value, not the translated value. 
											sbArray.Append("'" + Sql.EscapeJavaScript(xValue.InnerText) + "'");
										}
										lstField.Text = sb.ToString();
										// 08/01/2010   Array should be camel case. 
开发者ID:huamouse,项目名称:Taoqi,代码行数:67,代码来源:MergeView.ascx.cs

示例8: AppendEditViewFields


//.........这里部分代码省略.........
				{
					if ( !Sql.IsEmptyString(sDATA_FIELD) )
					{
						// 12/02/2007   If format rows > 0 then this is a list box and not a drop down list. 
						ListControl lstField = null;
						if ( nFORMAT_ROWS > 0 )
						{
							ListBox lb = new ListBox();
							lb.SelectionMode = ListSelectionMode.Multiple;
							lb.Rows          = nFORMAT_ROWS;
							lstField = lb;
						}
						else
						{
							// 04/25/2008   Use KeySortDropDownList instead of ListSearchExtender. 
							lstField = new KeySortDropDownList();
							// 07/26/2010   Lets try the latest version of the ListSearchExtender. 
							// 07/28/2010   We are getting an undefined exception on the Accounts List Advanced page. 
							// Lets drop back to using KeySort. 
							//lstField = new DropDownList();
						}
						tdField.Controls.Add(lstField);
						lstField.ID       = sDATA_FIELD;
						lstField.TabIndex = nFORMAT_TAB_INDEX;
						// 01/18/2010   Apply ACL Field Security. 
						lstField.Visible  = bLayoutMode || bIsReadable;
						lstField.Enabled  = bLayoutMode || bIsWriteable;

						try
						{
							// 10/09/2010   Add PARENT_FIELD so that we can establish dependent listboxes. 
							if ( !Sql.IsEmptyString(sPARENT_FIELD) )
							{
								ListControl lstPARENT_FIELD = tbl.FindControl(sPARENT_FIELD) as ListControl;
								if ( lstPARENT_FIELD != null )
								{
									lstPARENT_FIELD.AutoPostBack = true;
									// 11/02/2010   We need a way to insert NONE into the a ListBox while still allowing multiple rows. 
									// The trick will be to use a negative number.  Use an absolute value here to reduce the areas to fix. 
									EditViewEventManager mgr = new EditViewEventManager(lstPARENT_FIELD, lstField, bUI_REQUIRED, Sql.ToInteger(row["FORMAT_ROWS"]), L10n);
									lstPARENT_FIELD.SelectedIndexChanged += new EventHandler(mgr.SelectedIndexChanged);
									if ( !bIsPostBack && lstPARENT_FIELD.SelectedIndex >= 0 )
									{
										sCACHE_NAME = lstPARENT_FIELD.SelectedValue;
									}
								}
							}
							// 12/04/2005   Don't populate list if this is a post back. 
							if ( !Sql.IsEmptyString(sCACHE_NAME) && (bLayoutMode || !bIsPostBack) )
							{
								// 12/24/2007   Use an array to define the custom caches so that list is in the Cache module. 
								// This should reduce the number of times that we have to edit the SplendidDynamic module. 
								// 02/16/2012   Move custom cache logic to a method. 
								SplendidCache.SetListSource(sCACHE_NAME, lstField);
								lstField.DataBind();
								// 08/08/2006   Allow onchange code to be stored in the database.  
								// ListBoxes do not have a useful onclick event, so there should be no problem overloading this field. 
								if ( !Sql.IsEmptyString(sONCLICK_SCRIPT) )
									lstField.Attributes.Add("onchange" , sONCLICK_SCRIPT);
								// 02/21/2006   Move the NONE item inside the !IsPostBack code. 
								// 12/02/2007   We don't need a NONE record when using multi-selection. 
								// 12/03/2007   We do want the NONE record when using multi-selection. 
								// This will allow searching of fields that are null instead of using the unassigned only checkbox. 
								// 10/02/2010   It does not seem logical to allow a NONE option on a multi-selection listbox. 
								// 11/02/2010   We need a way to insert NONE into the a ListBox while still allowing multiple rows. 
								// The trick will be to use a negative number.  Use an absolute value here to reduce the areas to fix. 
开发者ID:huamouse,项目名称:Taoqi,代码行数:67,代码来源:SplendidDynamic.cs

示例9: SetObjValue

 /// <summary>
 /// 赋值
 /// </summary>
 /// <param name="htmltable">htmltable控件</param>
 /// <returns></returns>
 public List<ControlOR> SetObjValue(HtmlTable htmltable)
 {
     List<ControlOR> listObj = (List<ControlOR>)ViewState["List<ControlOR>"];
     if (listObj != null)
     {
         foreach (ControlOR obj in listObj)
         {
             if (obj.ControlType == "textbox")
             {
                 obj.ObjValue = ((TextBox)htmltable.FindControl(obj.CName)).Text;
             }
             else if (obj.ControlType == "checkbox")
             {
                 if (((CheckBox)htmltable.FindControl(obj.CName)).Checked)
                 {
                     obj.ObjValue = 1;
                 }
                 else
                 {
                     obj.ObjValue = 0;
                 }
             }
             else if (obj.ControlType == "dropdownlist")
             {
                 obj.ObjValue = ((DropDownList)htmltable.FindControl(obj.CName)).SelectedValue;
             }
         }
     }
     return listObj;
 }
开发者ID:ritacc,项目名称:ItMonitor,代码行数:35,代码来源:ControlCommon.cs

示例10: FindTextBoxByName

 private static ASPxTextBox FindTextBoxByName(string controlName, HtmlTable tblABM)
 {
     if (tblABM.FindControl("tx" + controlName) != null && tblABM.FindControl("tx" + controlName) is ASPxTextBox)
         return (ASPxTextBox)tblABM.FindControl("tx" + controlName);
     else
         return null;
 }
开发者ID:javierlov,项目名称:PautasElectronica,代码行数:7,代码来源:FormsHelper.cs


注:本文中的System.Web.UI.HtmlControls.HtmlTable.FindControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。