IAttributeAccessor.SetAttribute(String, String) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Quando implementado por uma classe, designa um atributo e o seu valor para atribuir ao controlo do servidor ASP.NET.
public:
void SetAttribute(System::String ^ key, System::String ^ value);
public void SetAttribute(string key, string value);
abstract member SetAttribute : string * string -> unit
Public Sub SetAttribute (key As String, value As String)
Parâmetros
- key
- String
O nome do atributo a definir.
- value
- String
O valor atribuído ao atributo.
Exemplos
O seguinte exemplo de código demonstra uma possível implementação do SetAttribute método.
// Implement the SetAttribute method for the control. When
// this method is called from a page, the control's properties
// are set to values defined in the page.
public void SetAttribute(String name, String value1)
{
ViewState[name] = value1;
}
' Implement the SetAttribute method for the control. When
' this method is called from a page, the control's properties
' are set to values defined in the page.
Public Sub SetAttribute(name As String, value1 As String) Implements IAttributeAccessor.SetAttribute
ViewState(name) = value1
End Sub