XElement xml = new XElement("Users", new XElement("User", new XAttribute("Username", Convert.ToString(txtUsername.Text.Trim())), new XElement("FirstName", txtFirstName.Text.Trim()), new XElement("LastName", txtLastName.Text.Trim()), new XElement("Email", txtEmail.Text.Trim()), new XElement("Mobile", txtMobile.Text.Trim()), new XElement("City", txtCity.Text.Trim()), new XElement("DateOfBirth", Convert.ToString(ddlDD.SelectedValue) + "/" + Convert.ToString(ddlMM.SelectedValue) + "/" + Convert.ToString(ddlYYYY.SelectedValue)), new XElement("Sex", Convert.ToString(ddlSex.SelectedValue)), new XElement("MaritalStatus", Convert.ToString(ddlMaritalStatus.SelectedValue)), new XElement("Password", txtPassword.Text.Trim()) ) );
1 comment:
XElement xml = new XElement("Users",
new XElement("User",
new XAttribute("Username", Convert.ToString(txtUsername.Text.Trim())),
new XElement("FirstName", txtFirstName.Text.Trim()),
new XElement("LastName", txtLastName.Text.Trim()),
new XElement("Email", txtEmail.Text.Trim()),
new XElement("Mobile", txtMobile.Text.Trim()),
new XElement("City", txtCity.Text.Trim()),
new XElement("DateOfBirth", Convert.ToString(ddlDD.SelectedValue) + "/" + Convert.ToString(ddlMM.SelectedValue) + "/" + Convert.ToString(ddlYYYY.SelectedValue)),
new XElement("Sex", Convert.ToString(ddlSex.SelectedValue)),
new XElement("MaritalStatus", Convert.ToString(ddlMaritalStatus.SelectedValue)),
new XElement("Password", txtPassword.Text.Trim())
)
);
Response.Write(xml.ToString());
Post a Comment