UserControl.Attributes Propriedade
Definição
Obtém uma coleção de todos pares de nome e valor do atributo declarados na marca de controle do usuário no arquivo .aspx.Gets a collection of all attribute name and value pairs declared in the user control tag within the .aspx file.
public:
property System::Web::UI::AttributeCollection ^ Attributes { System::Web::UI::AttributeCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.UI.AttributeCollection Attributes { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Attributes : System.Web.UI.AttributeCollection
Public ReadOnly Property Attributes As AttributeCollection
Valor da propriedade
Um objeto AttributeCollection que contém todos os pares de nome e valor declarados na marca de controle do usuário.An AttributeCollection object that contains all the name and value pairs declared in the user control tag.
- Atributos
Exemplos
O exemplo de código a seguir usa a propriedade do controle de usuário Attributes para acessar o Message atributo declarado na marca de controle personalizado que instanciou o controle de usuário na página que o contém.The following code example uses the user control's Attributes property to access the Message attribute declared in the custom control tag that instantiated the user control on the page that contains it.
// Retrieve and display the 'Message' attribute tag
// initialized in the .aspx code.
Response.Write("<b>Message tag value declared in the aspx file is : </b>" + myControl.Attributes["Message"]);
' Retrieve and display the 'Message' attribute tag
' initialized in the .aspx code.
Response.Write("<b>Message tag value declared in the aspx file is : </b>" + myControl.Attributes("Message"))