| Attribute | Example |
| BindableAttribute Design-time attribute. Specifies whether it is meaningful to bind data to a property. In a visual designer, the property browser can display a control's bindable properties in a dialog box. (For example, in Visual Studio, bindable properties are displayed in the DataBindings dialog box.) If a property is not marked with this attribute, the property browser infers the value to be Bindable(false). | [Bindable(true)] Applied to the Text property of the WelcomeLabel example control in Walkthrough: Developing and Using a Custom Server Control. |
| BrowsableAttribute Design-time attribute. Specifies whether a property should be displayed in a visual designer's property browser. Apply Browsable(false) to a property that you do not want to be displayed in the property browser. The default value, Browsable(true), is inferred by the property browser when a property is not marked with this attribute. | [Browsable(false)] Applied to the Template property in the VacationHome example control in Templated Server Control Example. |
| CategoryAttribute Design-time attribute. Specifies how to categorize the property in a visual designer's property browser. For example, Category("Appearance") tells the property browser to display the property in the Appearance category when the page developer uses category view in the property browser. You can specify a string argument corresponding to an existing category in the property browser or create your own category. | [Category("Appearance")] Applied to the Text property of the WelcomeLabel example control in Walkthrough: Developing and Using a Custom Server Control |
| DefaultValueAttribute Design-time attribute. Specifies a default value for a property. This value should be the same as the default value you return from the property accessor (getter). In some visual designers such as Visual Studio, the DefaultValueAttribute attribute allows a page developer to reset a property value to its default using the Reset command on the shortcut menu. | [DefaultValue("")] Applied to the Text property of the WelcomeLabel example control in Walkthrough: Developing and Using a Custom Server Control |
| DescriptionAttribute Design-time attribute. Specifies a brief description of the property. In a visual designer such as Visual Studio, the property browser displays the description of the selected property, typically at the bottom of the window. | [Description("The welcome message text.")] Applied to the Text property of the WelcomeLabel example control in Walkthrough: Developing and Using a Custom Server Control |
| DesignerSerializationVisibilityAttribute Design-time attribute. Specifies whether to serialize a property or its contents (such as subproperties or collection items) that are set at design time. The argument of the attribute's constructor is a value of the DesignerSerializationVisibility enumeration. The default value, Visible, is implied when this attribute is not applied, and the value of the property is serialized. | [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)] Applied to the Author property of the Book example control in Server Control Properties Example. |
| EditorAttribute Design-time attribute. Associates a custom UITypeEditor editor with a property or property type. If this attribute is applied to the type, it does not have to be applied to a property of that type. | [Editor(typeof(ContactCollectionEditor), typeof(UITypeEditor))] Applied to the Contacts property of the QuickContacts example control in Web Control Collection Property Example. |
| EditorBrowsableAttribute Design-time attribute. Specifies whether the property name appears in a source editor's IntelliSense list. This attribute can also be applied to methods and events. The argument of the attribute's constructor is a value of the EditorBrowsableState enumeration. The default value, Always, is implied when this attribute is not applied. | [EditorBrowsableAttribute (EditorBrowsableState.Never)] Apply the attribute shown in the preceding example to hide a member in IntelliSense. |
| FilterableAttribute Design-time and parse-time attribute. Specifies whether a property can participate in device and browser filtering. Filtering enables a page developer to specify different property values for different browsers within a single control declaration. For example, a page developer can use filtering to set different values for the Text property of a Label control, as shown in the following syntax:
<asp:Label UP:Text="Hello" and IE:Text="Welcome to my site" runat="server" />
"UP" and "IE" are browser filters. The default value Filterable(true) is implied when this attribute is not applied. | [Filterable(false)] Apply the attribute shown in the preceding example to exclude a property from device and browser filtering. |
| LocalizableAttribute Design-time attribute. Specifies whether it is meaningful to localize the property. When a property is marked Localizable(true), the property value is stored in a resource file. The default value, Localizable(false), is implied when this attribute is not applied. | [Localizable(true)] Applied to the Text property of the WelcomeLabel example control in Walkthrough: Developing and Using a Custom Server Control. |
| NotifyParentPropertyAttribute Design-time attribute. Specifies that in a property browser, changes made to a subproperty should be propagated to the parent property. | [NotifyParentProperty(true)] Applied to the FirstName, LastName, and MiddleName properties of the Author type defined in Server Control Properties Example. |
| PersistenceModeAttribute Design-time attribute. Specifies whether to persist a property as an attribute on the control's tag or as nested content within the control's tags. The argument of the attribute's constructor is a value of the PersistenceMode enumeration. | [PersistenceMode(PersistenceMode.InnerProperty)] Applied to the Author property of the Book example control in Server Control Properties Example. |
| TemplateContainerAttribute Design-time and parse-time attribute. Specifies the type of naming container for a property that returns an ITemplate interface. | [TemplateContainer(typeof(CustomTemplateContainer))] Apply the attribute shown in the preceding example to specify that the ITemplate property is represented by the CustomTemplateContainer class. |
| TemplateInstanceAttribute Design time and parse-time attribute. Specifies whether a template property allows the creation of single or multiple instances. If a template property is not extended with the TemplateInstanceAttribute attribute, multiple instances are the default. | [TemplateInstance(TemplateInstance.Single)] Apply the attribute shown in the preceding example to specify that only one instance of a template property can be created. |
| ThemeableAttribute Parse-time attribute. Specifies whether a control member can be affected by themes or control skins. By default, all properties exposed by a control can have themes applied if the control type itself can have themes applied. | [Themeable(false)] Apply the attribute shown in the preceding example to prevent a control member from being affected by themes or control skins. |
| TypeConverterAttribute Design-time, parse-time, and run-time attribute. Associates a type converter with a property or property type. Type converters perform conversions from a string representation to a given type and vice versa. | [TypeConverter(typeof(AuthorConverter))] Applied to the Author type defined in Server Control Properties Example. |
| UrlPropertyAttribute Design-time and run-time attribute. Specifies that a string property represents a URL value, which allows you to associate a URL builder with the property. | [UrlProperty("*.aspx",AllowedTypes=UrlTypes.Absolute|UrlTypes.RootRelative|UrlTypes.AppRelative)] Apply to set a specific file filter for ASP.NET files and allow absolute and relative paths. |