protected void Button1_Click(object sender, EventArgs e) { string fileName = "ToExcel" + DateTime.Now.ToString("yyyyMMddhhMMss") + ".xls"; string filepath = AppDomain.CurrentDomain.BaseDirectory + "Z_ToExcel\\" + fileName; string start = startdate.Text; string end = enddate.Text; SystemBLL BLL = new SystemBLL(); DataSet ds = BLL.GetDs(start, end); SaveExcel_Fb1(fileName, ds, this, filepath); filepath = "http://218.90.162.110:8889//Z_ToExcel//" + fileName; this.WindowLocation(filepath); }