Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

NonVisualControlAttribute Class

Defines the attribute that indicates whether a control is treated as a visual or non-visual control during design time. This class cannot be inherited.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
[AttributeUsageAttribute(AttributeTargets.Class)] 
public sealed class NonVisualControlAttribute : Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ 
public final class NonVisualControlAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class) 
public final class NonVisualControlAttribute extends Attribute
Not applicable.

The NonVisualControlAttribute attribute is applied to controls that are not rendered to the client, such as data source controls and the WebPartManager control. During design time, a page developer might decide to hide all non-visual controls. The designer would mark as invisible all of the controls with the NonVisualControlAttribute attribute set to true.

Examples of controls that employ the NonVisualControlAttribute attribute are DataSourceControl, HierarchicalDataSourceControl, HiddenField, and WebPartManager.

The following code example demonstrates how you can apply the NonVisualControlAttribute attribute to a class. In this example, the default NonVisualControlAttribute attribute is applied to a data source control. This is equivalent to the NonVisual field.

[NonVisualControlAttribute()]
public class CustomNonVisualControl : Control
{
    // Add an implementation of custom non-visual control.
}

System.Object
   System.Attribute
    System.Web.UI.NonVisualControlAttribute
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.