The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
XAttribute::SetValue Method (Object^)
.NET Framework (current version)
Sets the value of this attribute.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Parameters
- value
-
Type:
System::Object^
The value to assign to this attribute.
| Exception | Condition |
|---|---|
| ArgumentNullException | The value parameter is null. |
| ArgumentException | The value is an XObject. |
The following example creates an element with several attributes. It then changes the contents of one of the attributes.
This example produces the following output:
<Root Att1="content1" Att2="new content" Att3="content3" />
Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: