本文整理匯總了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);
}
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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.
示例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.
示例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;
}
示例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;
}