Export (0) Print
Expand All

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.

System.Object
  System.Attribute
    System.Web.UI.PersistenceModeAttribute

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

[AttributeUsageAttribute(AttributeTargets.All)]
public sealed class PersistenceModeAttribute : Attribute

The PersistenceModeAttribute type exposes the following members.

  NameDescription
Public methodPersistenceModeAttributeInfrastructure. Initializes a new instance of the PersistenceModeAttribute class.
Top

  NameDescription
Public propertyModeGets the current value of the PersistenceMode enumeration.
Public propertyTypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.)
Top

  NameDescription
Public methodEqualsInfrastructure. Compares the PersistenceModeAttribute object against another object. (Overrides Attribute.Equals(Object).)
Public methodGetHashCodeInfrastructure. Provides a hash value for a PersistenceModeAttribute attribute. (Overrides Attribute.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsDefaultAttributeInfrastructure. Indicates whether the PersistenceModeAttribute object is of the default type. (Overrides Attribute.IsDefaultAttribute().)
Public methodMatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberAttributeSpecifies that the property or event persists in the opening tag of the server control as an attribute. This field is read-only.
Public fieldStatic memberDefaultSpecifies the default type for the PersistenceModeAttribute class. The default is PersistenceMode.Attribute. This field is read-only.
Public fieldStatic memberEncodedInnerDefaultPropertySpecifies that a property is HTML-encoded and persists as the only inner content of the ASP.NET server control. This field is read-only.
Public fieldStatic memberInnerDefaultPropertySpecifies that a property persists as the only inner content of the ASP.NET server control. This field is read-only.
Public fieldStatic memberInnerPropertySpecifies that the property persists as a nested tag within the opening and closing tags of the server control. This field is read-only.
Top

  NameDescription
Explicit interface implemetationPrivate method_Attribute.GetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers. (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoRetrieves the type information for an object, which can be used to get the type information for an interface. (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.GetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from Attribute.)
Explicit interface implemetationPrivate method_Attribute.InvokeProvides access to properties and methods exposed by an object. (Inherited from Attribute.)
Top

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

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;
   }
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

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