Assembly: System.Web (in system.web.dll)
<AttributeUsageAttribute(AttributeTargets.Class)> _ Public NotInheritable Class ToolboxDataAttribute Inherits Attribute
Dim instance As ToolboxDataAttribute
[AttributeUsageAttribute(AttributeTargets.Class)] public sealed class ToolboxDataAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class)] public ref class ToolboxDataAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ public final class ToolboxDataAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class) public final class ToolboxDataAttribute extends Attribute
By default, the visual designer of a tool such as Visual Studio, creates an empty tag. This is a tag representing a control in its default state, when the control is dropped from the toolbox of a visual designer onto the design surface. To specify initial default values, a control can make use of this attribute. You can use this attribute to customize the initial HTML content that is placed in the designer when the control is dragged from the toolbox onto the form.
[ ToolboxData("<{0}:MyLabel runat= server Text=
MyLabel><{0}:MyLabel>") ]public class MyLabel : Label {...}
In the following code example, the previous code sets several properties specific to MyLabel. All occurrences of {0} are replaced, by the designer, with the tag prefix associated with the MyLabel class.
Imports System Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls Namespace CustomControls <ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow' BackColor='Magenta' BorderWidth = '10' runat='server'></{0}:MyLabel>")> _ Public Class MyLabel Inherits Label Public Sub New() 'Your code goes here. End Sub 'New End Class 'MyLabel End Namespace 'CustomControls
using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace CustomControls { [ ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow' BackColor='Magenta' BorderWidth = '10' runat='server'></{0}:MyLabel>") ] public class MyLabel : Label { public MyLabel() { // Your code goes here. } } }
import System.*;
import System.Web.*;
import System.Web.UI.*;
import System.Web.UI.WebControls.*;
/** @attribute ToolboxData("<{0}:MyLabel Text='MyLabel' BorderColor='Yellow'"
+ "BackColor='Magenta' BorderWidth = '10' runat='server'></{0}:MyLabel>")
*/
public class MyLabel extends Label
{
public MyLabel()
{
// Your code goes here.
} //MyLabel
} //MyLabel
System.Attribute
System.Web.UI.ToolboxDataAttribute
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
.NET Framework
Supported in: 2.0, 1.1, 1.0Reference
ToolboxDataAttribute MembersSystem.Web.UI Namespace
Attribute