HtmlContainerControl

HtmlContainerControldisposable

System.Web.UI.HtmlControls (system.web.dll)abstract class

This abstract class provides functionality for all HTML server controls that require closing tags. For example, an HtmlAnchor control must always be closed (<a>Text</a> and <a/> are valid anchor tags, but <a> alone is not). An HtmlImage control, on the other hand, does not need a closing tag.

Every control that requires a closing tag has the ability to contain text. This information is provided through the InnerText and InnerHtml properties. Both properties retrieve all the content between the opening and closing control tag. The difference is that InnerText automatically encodes and decodes special characters into their corresponding HTML entities. For example, if you set the InnerText property to <b>Hello</b>, the < and > symbols are converted to the HTML equivalents &lt; and &gt;. This instructs the browser to display <b>Hello</b> as plain text. However, if you set the InnerHtml property to <b>Hello</b>, the < and > symbols will be interpreted as HTML markup tags and the word "Hello" will be displayed in bold.

public abstract class HtmlContainerControl : HtmlControl { // Public Constructors    public HtmlContainerControl( );    public HtmlContainerControl(string tag); // Public Instance Properties    public virtual string InnerHtml{set; get; }    public virtual string InnerText{set; get; } // Protected Instance Methods    protected override ControlCollection CreateControlCollection(    );  // overrides HtmlControl    protected override void LoadViewState(object savedState);    // overrides System.Web.UI.Control    protected override void Render(System.Web.UI.HtmlTextWriter writer);  // overrides HtmlControl    protected override void RenderAttributes(System.Web.UI.HtmlTextWriter writer); // overrides HtmlControl     protected virtual void RenderEndTag(System.Web.UI.HtmlTextWriter writer); }

Hierarchy

System.Object System.Web.UI.Control(System.ComponentModel.IComponent, System.IDisposable, System.Web.UI.IParserAccessor, System.Web.UI.IDataBindingsAccessor) HtmlControl(System.Web.UI.IAttributeAccessor) HtmlContainerControl

Subclasses

HtmlAnchor, HtmlButton, HtmlForm, HtmlGenericControl, HtmlSelect, HtmlTable, HtmlTableCell, HtmlTableRow, HtmlTextArea



ASP. NET in a Nutshell
ASP.NET in a Nutshell, Second Edition
ISBN: 0596005202
EAN: 2147483647
Year: 2003
Pages: 873

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net