Bonjour
Ci-dessous un exemple (bouton BT_TELECHARGER )
protected void BT_TELECHARGER_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment; filename = "+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")+"View_AppelAstreinte.xls"); Response.ContentType = "application/vnd.xls"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); DATA_VIEW.RenderControl(htmlWrite); Response.Write(stringWrite.ToString()); Response.End(); } public override void VerifyRenderingInServerForm(Control control) { /* Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. */ }