Reputation: 59
Probably another easy one but I cant find the answer and cant work it out.
I have a outerxml packet for example
<field1 id="abc" passed="False">
<field2 id="BCD" reason="yada"/>
</field1>
in asp.net (c#) how can I retrieve the value of "reason"?
Upvotes: 1
Views: 1247
Reputation: 149598
You can use LINQ to XML:
string reason = (string)xml.Element("field1").Element("field2").Attribute("reason");
Upvotes: 1