ToolboxDataAttribute

ToolboxDataAttribute

System.Web.UI (system.web.dll)sealed class

This attribute is used when you are creating your own custom controls (typically by inheriting from System.Web.UI.WebControls.WebControl or Control). By default, designers like Visual Studio .NET will create an empty tag when you drag a control from the toolbox onto the design surface. This empty tag represents a control in its default state. Rather than using the empty tag, you can specify initial values and default HTML will be placed inside the control tag by using this attribute. For example, the attribute <ToolboxData("<{0}:MyLabel Text='MyLabel' BackColor='Yellow' runat='server'></{0}:MyLabel>")> configures the initial tag for a custom label control with a yellow background. Note that all occurrences of {0} in the supplied Data string will be replaced, by the designer, with the tag prefix associated with the MyLabel class.

public sealed class ToolboxDataAttribute : Attribute { // Public Constructors    public ToolboxDataAttribute(string data); // Public Static Fields    public static readonly ToolboxDataAttribute Default; // =System.Web.UI.ToolboxDataAttribute // Public Instance Properties    public string Data{get; } // Public Instance Methods    public override bool Equals(object obj);        // overrides Attribute    public override int GetHashCode( );               // overrides Attribute    public override bool IsDefaultAttribute( );       // overrides Attribute }

Hierarchy

System.Object System.Attribute ToolboxDataAttribute

Valid On

Class



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