Редагувати

Поділитися через


NonVisualControlAttribute Constructors

Definition

Initializes a new instance of the NonVisualControlAttribute class.

Overloads

NonVisualControlAttribute()

Initializes a new instance of the NonVisualControlAttribute class.

NonVisualControlAttribute(Boolean)

Initializes a new instance of the NonVisualControlAttribute class, using the specified Boolean value to determine whether the attribute represents a visual or non-visual control.

NonVisualControlAttribute()

Initializes a new instance of the NonVisualControlAttribute class.

public:
 NonVisualControlAttribute();
public NonVisualControlAttribute ();
Public Sub New ()

Examples

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.
}
<NonVisualControlAttribute()> _
Public Class CustomNonVisualControl
    Inherits Control

    ' Add an implementation of custom non-visual control.

End Class

Remarks

A default instance of the NonVisualControlAttribute class is equivalent to the NonVisual field, or passing true to the NonVisualControlAttribute.NonVisualControlAttribute(Boolean) constructor.

See also

Applies to

NonVisualControlAttribute(Boolean)

Initializes a new instance of the NonVisualControlAttribute class, using the specified Boolean value to determine whether the attribute represents a visual or non-visual control.

public:
 NonVisualControlAttribute(bool nonVisual);
public NonVisualControlAttribute (bool nonVisual);
new System.Web.UI.NonVisualControlAttribute : bool -> System.Web.UI.NonVisualControlAttribute
Public Sub New (nonVisual As Boolean)

Parameters

nonVisual
Boolean

true to initialize the NonVisualControlAttribute to represent a Web control that is not rendered to the client at run time; otherwise, false.

Examples

The following code example demonstrates how you can apply the NonVisualControlAttribute attribute to a class. In this example, a data source control is designated as a non-visual control by passing true to the attribute.

[NonVisualControlAttribute(true)]
public class CustomNonVisualControl2 : Control
{
    // Add an implementation of custom non-visual control.
}
<NonVisualControlAttribute(True)> _
Public Class CustomNonVisualControl2
    Inherits Control

    ' Add an implementation of custom non-visual control.

End Class

Remarks

Passing true to this constructor is equivalent to using the NonVisual field, and passing false is equivalent to using the Visual field.

Applies to