Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
I hav one xml file.when i upload that xml file and click the submit button ,The content inside the tag should be displayed in label and the value for particular tag should be displayed in coreesponding textbox for that label.

please help me.

Thanks in Advance.
Posted
Updated 11-Jul-11 0:13am
v2

Hi,

You'l have to use XML document like this

XmlDocument xd = new XmlDocument();
                xd.LoadXml(xmltoread);//loading XML
                var node = xd.GetElementsByTagName(nodename)[0];//reading node name [0],if  node no is > 0
                var outcome = node.Attributes["outcome"].Value;//End//printing in a variable or any control
 
Share this answer
 
You can use LINQ to XML[^] a really easy way to query for XML data.

Basic Queries (LINQ to XML)[^] samples.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900