This article will show you how you can read an XMl node using
c#.net. this code you can use in your asp.net, mvc application.
So here is you XML file .
<?xml version="1.0" encoding="utf-8" ?> <root> <node1>Node 1
Value</node1> <node2>Node 2
Value</node2> <node3>Node 3
Value</node3> <node4>Node 4
Value</node4> </root> |
string xmlFilePath = @"\App_Data\Node.xml"; XDocument
_xdocument = XDocument.Load(Server.MapPath(xmlFilePath)); var xmlNnode =
_xdocument.Descendants().Where(n => n.Name == "node3").FirstOrDefault(); string nodeValue; if (xmlNnode != null) { nodeValue
= xmlNnode.Value; } |
0 comments:
Please let me know your view