本文整理汇总了C#中System.Web.UI.WebControls.TableCell.FindControl方法的典型用法代码示例。如果您正苦于以下问题:C# TableCell.FindControl方法的具体用法?C# TableCell.FindControl怎么用?C# TableCell.FindControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.TableCell
的用法示例。
在下文中一共展示了TableCell.FindControl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSideBar
void CreateSideBar (TableCell sideBarCell)
{
RegisterApplyStyle (sideBarCell, SideBarStyle);
if (SkipLinkText != "") {
System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
anchor.HRef = "#" + ClientID + "_SkipLink";
Image img = new Image ();
ClientScriptManager csm = new ClientScriptManager (null);
img.ImageUrl = csm.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif");
img.Attributes.Add ("height", "0");
img.Attributes.Add ("width", "0");
img.AlternateText = SkipLinkText;
anchor.Controls.Add (img);
sideBarCell.Controls.Add (anchor);
}
if (sideBarTemplate != null) {
sideBarTemplate.InstantiateIn (sideBarCell);
stepDatalist = sideBarCell.FindControl (DataListID) as DataList;
if (stepDatalist == null)
throw new InvalidOperationException ("The side bar template must contain a DataList control with id '" + DataListID + "'.");
stepDatalist.ItemDataBound += new DataListItemEventHandler(StepDatalistItemDataBound);
} else {
stepDatalist = new DataList ();
stepDatalist.ID = DataListID;
stepDatalist.SelectedItemStyle.Font.Bold = true;
stepDatalist.ItemTemplate = SideBarItemTemplate;
sideBarCell.Controls.Add (stepDatalist);
}
if (SkipLinkText != "") {
System.Web.UI.HtmlControls.HtmlAnchor anchor = new System.Web.UI.HtmlControls.HtmlAnchor ();
anchor.ID = "SkipLink";
sideBarCell.Controls.Add (anchor);
}
stepDatalist.ItemCommand += new DataListCommandEventHandler (StepDatalistItemCommand);
stepDatalist.CellSpacing = 0;
stepDatalist.DataSource = WizardSteps;
stepDatalist.SelectedIndex = ActiveStepIndex;
stepDatalist.DataBind ();
}
示例2: CreateSideBar
void CreateSideBar (TableCell sideBarCell)
{
RegisterApplyStyle (sideBarCell, SideBarStyle);
if (sideBarTemplate != null) {
sideBarTemplate.InstantiateIn (sideBarCell);
stepDatalist = sideBarCell.FindControl (DataListID) as DataList;
if (stepDatalist == null)
throw new InvalidOperationException ("The side bar template must contain a DataList control with id '" + DataListID + "'.");
} else {
stepDatalist = new DataList ();
stepDatalist.ID = DataListID;
sideBarCell.Controls.Add (stepDatalist);
}
stepDatalist.DataSource = WizardSteps;
stepDatalist.ItemTemplate = sideBarItemTemplate;
stepDatalist.DataBind ();
}
示例3: GetValue
/// <summary>
/// Gets the current value of the specified <see cref="TableCell"/> object.
/// </summary>
/// <param name="cell">The current <see cref="TableCell"/> object.</param>
/// <param name="controlId">The nested control's ID property value.</param>
/// <param name="controlProperty">The nested control's value property name.</param>
/// <returns>The current value.</returns>
public Object GetValue(TableCell cell, String controlId, String controlProperty)
{
Object value = null;
if ( String.IsNullOrEmpty(controlId) )
{
value = cell.Text;
}
else
{
Control control = cell.FindControl(controlId);
value = FormUtil.GetValue(control, controlProperty);
}
return value;
}
示例4: AddTemplateCell
void AddTemplateCell (TableRow row, ITemplate template, params string[] buttonIds)
{
TableCell cell = new TableCell ();
template.InstantiateIn (cell);
foreach (string id in buttonIds) {
IButtonControl b = cell.FindControl (id) as IButtonControl;
if (b != null) RegisterCommandEvents (b);
}
row.Cells.Add (cell);
}
示例5: SetValue
/// <summary>
/// Sets the current value of the specified <see cref="TableCell"/> object.
/// </summary>
/// <param name="cell">The current <see cref="TableCell"/> object.</param>
/// <param name="controlId">The nested control's ID property value.</param>
/// <param name="controlProperty">The nested control's value property name.</param>
/// <param name="value">The current value.</param>
public void SetValue(TableCell cell, String controlId, String controlProperty, Object value)
{
if ( cell != null )
{
if ( String.IsNullOrEmpty(controlId) )
{
cell.Text = String.Format("{0}", value);
}
else
{
Control control = cell.FindControl(controlId);
FormUtil.SetValue(control, controlProperty, value);
}
}
}