I want to get the node by his name and not by his item id, at the moment i have this:
XmlNode xmlNodoDebug = docWebConfig.DocumentElement.SelectSingleNode("system.web/compilation");
Response.Write(xmlNodoDebug.Attributes.Item(1).Value); // returns value "true"
My XML is the Web.Config of other C# projects:
<compilation defaultLanguage="c#" debug="true" />
I want to get the value of that node by his name, “debug”.
try this:
xmlNodoDebug.Attributes[“debug”].Value;