Microsoft .NET introduces a new suite of XML APIs built on industry standards such as DOM, XPath, XSD, and XSLT. The .NET Framework XML classes also offer convenience, better performance, and a more familiar programming model, tightly coupled with the new .NET data access APIs—ADO .NET. XmlWriter, XmlReader, and XmlNavigator classes and classes that derive from them, including XMLTextReader and XMLTextWriter, encapsulate a number of functionalities that previously had to be accomplished manually. This tutorial will show you a sample of how to operate XML in ASP.NET and C#.

The System.Xml namespace contains the XmlDocument Class .we can use this class to operate xml file. For instance, add, modify, delete and clear data to XML file.

At first, import the namespace of System.Xml

Add four buttons to web page. They are Add, modify, Delete and Clear.

Add 2 functions: One is loadXmlData, and the other is FindXmlData.

The front page of Default.aspx

The code behind the front page

Download Source Files