Response.Writein these cases, you'd want your ASPX markup to be empty otherwise you'll end up with a
Server cannot set content type after HTTP headers have been sentexception that if you've done WebForms development you know full well what the cause is. For those that don't, the important thing to remember is you need to return only the file you are returning. That means no HTML markup in your ASPX file. Upon deploying the code to my development server I received this exception: Easy solution? Update your
Theme=""on the page you want to have an empty markup. [csharp] <%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" StylesheetTheme="" Theme="" CodeBehind="FileExport.aspx.cs" Inherits="SomeWebApp.Common.FileExport" %> [/csharp] Not something I run into very often as I roll my own Theming Support, but for those in a legacy situation or inherited code as I did in this case, I hope this helps.