IAttributeAccessor.GetAttribute(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When implemented by a class, retrieves the specified attribute property from the server control.
public:
System::String ^ GetAttribute(System::String ^ key);
public string GetAttribute (string key);
abstract member GetAttribute : string -> string
Public Function GetAttribute (key As String) As String
Parameters
Returns
The value of the specified attribute.
Examples
The following code example demonstrates an implementation of the GetAttribute method.
// Implement the GetAttribute method for the control. When
// this method is called from a page, the values for the control's
// properties can be displayed in the page.
public String GetAttribute(String name)
{
return (String)ViewState[name];
}
' Implement the GetAttribute method for the control. When
' this method is called from a page, the values for the control's
' properties can be displayed in the page.
Public Function GetAttribute(name As String) As String Implements IAttributeAccessor.GetAttribute
Return CType(ViewState(name), String)
End Function 'GetAttribute
Applies to
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET