using System using System IO using System Xml Serialization using CHXS

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.IO;
using System.Xml.Serialization;
using CHXSD;
namespace CompaniesHouseSF
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CHXSD.CompanyIncorporation inc = new CompanyIncorporation();
inc.SameDay = true;
inc.Agent = new CompanyIncorporationAgent();
inc.Agent.Person = new NameType();
inc.Agent.Person.Forename = "MR FIRST";
XmlSerializer xs = new XmlSerializer(typeof(CompanyIncorporation));
StringWriter str = new StringWriter();
xs.Serialize(str, inc);
literal1.Text = Server.HtmlEncode(str.ToString());
str.Close();
}
}
}