PersistenceModeAttribute Class
 

Defines the metadata attribute that specifies how an ASP.NET server control property or event is persisted to an ASP.NET page at design time. This class cannot be inherited.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

SystemObject
   SystemAttribute
    System.Web.UIPersistenceModeAttribute

[AttributeUsageAttribute(AttributeTargets.All)]
public sealed class PersistenceModeAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::All)]
public ref class PersistenceModeAttribute sealed : Attribute
[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.All)>]
type PersistenceModeAttribute = 
    class
        inherit Attribute
    end
<AttributeUsageAttribute(AttributeTargets.All)>
Public NotInheritable Class PersistenceModeAttribute
	Inherits Attribute
NameDescription
System_CAPS_pubmethod PersistenceModeAttribute

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the PersistenceModeAttribute class.

NameDescription
System_CAPS_pubproperty

Gets the current value of the PersistenceMode enumeration.

System_CAPS_pubproperty

When implemented in a derived class, gets a unique identifier for this Attribute.(Inherited from Attribute.)

NameDescription
System_CAPS_pubmethod Equals

This API supports the product infrastructure and is not intended to be used directly from your code. Compares the PersistenceModeAttribute object against another object.(Overrides AttributeEquals.)

System_CAPS_pubmethod GetHashCode

This API supports the product infrastructure and is not intended to be used directly from your code. Provides a hash value for a PersistenceModeAttribute attribute.(Overrides AttributeGetHashCode.)

System_CAPS_pubmethod GetType

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethod IsDefaultAttribute

This API supports the product infrastructure and is not intended to be used directly from your code. Indicates whether the PersistenceModeAttribute object is of the default type.(Overrides AttributeIsDefaultAttribute.)

System_CAPS_pubmethod Match

When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.(Inherited from Attribute.)

System_CAPS_pubmethod ToString

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubfield System_CAPS_static Attribute

Specifies that the property or event persists in the opening tag of the server control as an attribute. This field is read-only.

System_CAPS_pubfield System_CAPS_static Default

Specifies the default type for the PersistenceModeAttribute class. The default is PersistenceMode.Attribute. This field is read-only.

System_CAPS_pubfield System_CAPS_static EncodedInnerDefaultProperty

Specifies that a property is HTML-encoded and persists as the only inner content of the ASP.NET server control. This field is read-only.

System_CAPS_pubfield System_CAPS_static InnerDefaultProperty

Specifies that a property persists as the only inner content of the ASP.NET server control. This field is read-only.

System_CAPS_pubfield System_CAPS_static InnerProperty

Specifies that the property persists as a nested tag within the opening and closing tags of the server control. This field is read-only.

NameDescription
System_CAPS_pubinterface System_CAPS_privmethod _AttributeGetIDsOfNames

Maps a set of names to a corresponding set of dispatch identifiers.(Inherited from Attribute.)

System_CAPS_pubinterface System_CAPS_privmethod _AttributeGetTypeInfo

Retrieves the type information for an object, which can be used to get the type information for an interface.(Inherited from Attribute.)

System_CAPS_pubinterface System_CAPS_privmethod _AttributeGetTypeInfoCount

Retrieves the number of type information interfaces that an object provides (either 0 or 1).(Inherited from Attribute.)

System_CAPS_pubinterface System_CAPS_privmethod _AttributeInvoke

Provides access to properties and methods exposed by an object.(Inherited from Attribute.)

For more information about using attributes, see Extending Metadata Using Attributes.

System_CAPS_noteNote

The Web page designer in Visual Studio does not support the ResetPropertyName method that is optionally exposed by Windows Forms controls for property persistence. Server controls are serialized using methods provided by the ControlPersister class. The implementation of these methods is driven by metadata attributes such as DefaultValueAttribute, PersistenceModeAttribute, and DesignerSerializationVisibilityAttribute.

[PersistenceMode(PersistenceMode.InnerProperty),
TemplateContainer(typeof(TemplateItem))]
public ITemplate MessageTemplate {
   get {
      return _messageTemplate;
   }
   set {
      _messageTemplate = value;
   }
}

<PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(TemplateItem))> Public Property MessageTemplate() As ITemplate
   Get
      Return _messageTemplate
   End Get
   Set(ByVal Value As ITemplate)
      _messageTemplate = Value
   End Set
End Property
.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top