Professional Documents
Culture Documents
Using Using Using Using Using Using Using Using Using Using Public Partial Class Protected Void Object
Using Using Using Using Using Using Using Using Using Using Public Partial Class Protected Void Object
Using Using Using Using Using Using Using Using Using Using Public Partial Class Protected Void Object
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
}
protected void Button1_Click(object sender, EventArgs e)
{
//Create a new xmlDataDocument
//The familie
//Create attributes
version.Value = "1.0";
encoding.Value = "utf-8";
wrapper.Attributes.Append(version);
wrapper.Attributes.Append(encoding);
//The Father
//Create attributes
FatherAge.Value = "65";
Father.Attributes.Append(FatherName);
Father.Attributes.Append(FatherAge);
Familie.AppendChild(Father);
//The mother
//Create attributes
MotherAge.Value = "60";
Mother.Attributes.Append(MotherName);
Mother.Attributes.Append(MotherAge);
Familie.AppendChild(Mother);
//The sister
//Create attributes
Sister.Attributes.Append(SisterName);
Sister.Attributes.Append(SisterAge);
Familie.AppendChild(Sister);
//The brother
//Create attributes
BrotherAge.Value = "21";
Brother.Attributes.Append(BrotherName);
Brother.Attributes.Append(BrotherAge);
Familie.AppendChild(Brother);
wrapper.AppendChild(Familie);
myDoc.AppendChild(wrapper);
myDoc.Save(@"C:\myFamilie.xml");