protected void btnExportXML_Click(object sender, EventArgs e) { if (Page.IsValid) { try { string fileName = string.Format("customers_{0}.xml", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); CustomerCollection customers = GetCustomers(); string xml = ExportManager.ExportCustomersToXml(customers); CommonHelper.WriteResponseXml(xml, fileName); } catch (Exception exc) { ProcessException(exc); } } }