IAttributeAccessor.SetAttribute(String, String) Metodo

Definizione

Se implementato da una classe, designa un attributo e il relativo valore da assegnare al controllo server 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)

Parametri

key
String

Nome dell'attributo da impostare.

value
String

Valore assegnato all'attributo .

Esempio

Nell'esempio di codice seguente viene illustrata una possibile implementazione del SetAttribute metodo .

// 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

Si applica a