[HowTo] Write Excel file to web page (aspx)
Writing an Excel file to the response object in ASP.NET is quite easy… This piece of code works with most of the files type… string YourFilename = “test.xlsx”; string path = Server.MapPath(YourPath + YourFilename); Response.ClearContent(); Response.AddHeader(“content-disposition”, “attachement;filename=” + YourFilename); // Ouvrir avec MSExcel Response.ContentType = “application/ms-excel”; // MSWord // Response.ContentType = “application/msword”; // Text // […]
[HowTo] Define a constant globaly in C# (like DEBUG)
You can add the define compiler switch in your IDE. Open the project’s Property Pages dialog box. Click the Configuration Properties folder. Click the Build property page. Modify the Conditional Compilation Constants property