protected void btnOpenSampleExcel_Click(object sender, EventArgs e) { try { string fileName = "SampleRetsServerCredentials.csv"; string filePath = Server.MapPath("/SampleRetsCredential\\SampleRetsServerCredentials.csv"); Response.AppendHeader("content-disposition", "filename=" + fileName); Response.ContentType = "application/octet-stream"; Response.WriteFile(filePath, false); } catch (Exception ex) { _alertMessage = "Sorry, cant show the sample file now! Please try after some time."; radManager.RadAlert("message", 400, null, "title", null); } }
Response.Clear(); Response.AppendHeader("content-disposition", "filename=" + fileName); Response.ContentType = "application/octet-stream"; Response.WriteFile(filePath, false);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)