Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create XML file ?
Message
General information
Forum:
ASP.NET
Category:
Mobile development
Miscellaneous
Thread ID:
00767870
Message ID:
00767900
Views:
8
Can someone give me a direction or a small sample code (in C# or VB .NET) for the following:

I have a simple web page (ASP.NET) which has 2 or 3 textboxes. When user clicks on Submit button I want to add values from the text boxes to an XML file. If you know of a white paper or a article which describes how to do what I want, please let me know.


Here something to get you started - just cut and paste onto a console app:
using System;
using System.Xml;

// Console Application
class XMLSample
{
     static void Main()
     {
          XmlDocument oXml = new XmlDocument();
          XmlElement oRoot = oXml.CreateElement("RootNode");
          oXml.AppendChild(oRoot);
          for(int i=1;i<10;i++)
          {
               XmlElement oChild = oXml.CreateElement("ChildNode");
               oChild.InnerText = "The text between the tags";
               oRoot.AppendChild(oChild);
          }
          
          Console.WriteLine(oRoot.OuterXml);
     }
}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform