Export (0) Print
Expand All

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)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class NonVisualControlAttribute : Attribute

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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft