Not able to use Response.write for writing to Excel, when using Response content compression

We have the Excel download option for our page, for which we use Response.ContentType as application/vnd.ms-excel and writing the data to Excel stream using Response.write.  As we apply Respone fileter for compressing the response content, this is not working.

Considering the performance we don't want to disable the compression.  can anyone give some suggestions?

Thanks in advance. 

 

0
sureshb_in
7/24/2008 7:19:17 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
1826 Views

Similar Articles

[PageSpeed] 7
Get it on Google Play
Get it on Apple App Store

 Disabling the compression for these particular requests would be OK, wouldn't it?

However, a compressing response filter should not be a problem, even with application/vnd.ms-excel. Could you describe your setup and code in more detail?


-- "Mark As Answer" if my reply helped you --
0
gunteman
7/24/2008 11:00:21 AM

Hi gunteman,

Thanks for your reponse.  Forgot to update the post.  Managed to found the same type of solution. 

Actually we were doing the compression in the Httpmodule where I checked the

 Application.Context.CurrentHandler

 which gives the page from which the request is coming.  So we skipped the compression for that particular page where we write to excel.

 

 

0
sureshb_in
7/24/2008 11:42:40 AM
Reply:

Similar Artilces:

How can I write from DataSet using Response.Write()?
How can I write from DataSet using Response.Write()? Do u want to write out the records data using Response.Write()??Shravan Addaypally MCP yes anyone.....? Dim dc As DataColumn Dim dr As DataRow For Each dr In ds.Tables(0).Rows For Each dc In ds.Tables(0).Columns Response.Write(dr(dc.ColumnName).ToString()) Next Next Sushila Bowalekar PatelVisual ASP/ASP.NET MVPhttp://weblogs.asp.net/sushilasb Response.Write(ds.tables(0).rows.item(3).item(2)) That will output Table #0, row #4, column #3 (zero based indexing) You'll need to put that in a f...

Using Response.OutputStream.Write for Sending Response to the client
 Hi All, I have a small program that is trying to POST and XML to an ASP.net aspx web page. I am using WebRequest and WebResponse classes for communication between aspx and client program. Communication from client to aspx page has no problems and I am able to read complete XML file. To send a response back to the client ( a c# program) I create an XML file and convert it into byte stream and I use Response.OutputStream.Write() function to send message. On the client end I receive the message but it is followed by some standard HTML text (which is required for the aspx page. ...

writing output at desired location using response.write
when i write with the response.write("value"); on webpage .it writes it at particular location on webpage, suppose i want write this on the location, other than the particular location.how to do this with response.write Response.Write will just literally spit your code at the top of the page... If you want to assign a string somewhere on your page... put a "Literal" there, and then set it's "Text" property. <asp:Literal ID="myLiteral" runat="server" /> And then in your code behind... instead of response.write do, myLiteral.Text = "value"; Peace,-Timothy Khourihttp://www.Singin...

using response.write and .net datareader
Hi, Is it possible to specify the actual name of the data using a .net datareader (to get data from a sql server database)? Ideally I would like to be able to do : response.write (reader("ProjectName")) is this the write syntax?  Also is it possible to create a string based on the data name myString=reader("ProjectName")   Many thanks Mark :)  You can refer to the column name like this example (and yes you can use the same method to set a variable):  While MyDataReader.Read Response.Write("Name: " & MyDa...

Using Response.Redirect and Response.Write from flat class file
Setup: I developed an interface that holds certain functions that are shared between some users in my system. The different users are grouped into classes that implement that interface. Problem: In some instances the implementations of this interface include a mere write to the screen or a redirect. However, when I attempt to do something like Response.write or Response.redirect from those classes, I am getting an error that says "Response is not Available in this Context" Question: Is what I am trying to do possible and if so, how do I correct this problem. ...

Won't let me use both Response.Write and Response.Redirect in same function?
Below is my code:Response.Write("&lt;script language='javascript'>window.open ('Saved Form.htm' ,'NewWindowName', 'width=400, height=400, toolbar=no, resizable=no');</script>"); Response.Redirect("forms.aspx?Form=sale");  Those two lines are in a function. When that function is called it directly redirects me to forms.aspx without opening the new window first. How can I fix that so that it opens the new window and then redirects the user to a different page in the old window. Using Visual Studio 2005. Language: C# ...

Using Response.Write
I have an Aspx page with a form and a table within the form. When I click on the <asp:button> I call a method to process the page. The problem is that the Response.Write statements are displayed back on the browser before the html that I coded in the page. This causes the Submit button to now be below the actual report generated from the Repsonse.Write Statments. Any suggestions. Thanks. you can use <asp:label id="label1" runat=server/> control instead of response.write in the code u can write label1.text = YourString response.write is an ASP ...

Using Response.Write in a Page_Load Event of a Content Page
Hi, I'm getting a bit confused with this. I tried to show some info through the HttpContext class in a Content Page. I'll show the code snippet: [...] Page_Load Event HttpContext.Current.Response.Write("A simple string") [...] If I run the context.aspx page, the output of the page it's modified because it renders as the first element at the top of the page, outside of the content control, the string added to the Response object. Is this normal? Should not be inside the Content Control of the Content.aspx Page? Thanks in advanceVB .Net Coder - Apologize my C# nesci...

Using Response.Write from a class not inherited from Web.UI.Page
Hey folks, I have a utilities.cs class in my web app that includes a SendEmail routine to send emails when users do certain tasks. In that routine, after I've sent the email, I want to pop up a Javascript alert box to confirm the email has been sent (or not sent if there was an error)... but since my utilities class does not inherit the Page class it won't allow me to do the Response.Write("<SCRIPT>Alert('Email sent!');<?SCRIPT>" line like I want to... anyone know how I can do this or get around it? I'm sure there's a library I can import which exposes web method...

What’s the difference between Response.Write() and Response.Output.Write()?
Response.Write() gives a formated output OR Response.Output.Write() gives a formated output. Friend, The difference between Response.Write() and Response.Output.Write() in ASP.NET. The short answer is that the latter gives you String.Format-style output and the former doesn't. The long answer follows.In ASP.NET the Response object is of type HttpResponse and when you say Response.Write you're really saying (basically) HttpContext.Current.Response.Write and calling one of the many overloaded Write methods of HttpResponse. Response.Write then calls .Write() on it's internal Text...

How to display data from a 'stored procedure' using Response.Write in VB.NET
Hello,  I'm new to vb.net and need to know how to call a stored procedure and display the results using Response.Write()   There are not a lot of examples online because this is not the idea way to do things, but it's not my choice as I have to work within the existing code and change the sql statements to stored procedures.    Any help is greatly appreciated.....Here is what I have so far:    1 Imports System.Data.SQLClient 2 3 Dim sConnection As String = ConfigurationManager.ConnectionStrings("ConnString").Connect...

Requirements for using Response.Write ?
I'm defining a custom class, and Visual Studio is complaining that 'Response' is not a declared variable. What namespace do I have to import to be able to use Response.Write() ? You should first get a reference to the current HttpContext and then use the Request object like: System.Web.HttpContext.Current.Request HTH, VivekSocial Networking Platform in ASP.NET || Join now: CodeASP.NET Community Please mark the most helpful reply/replies as "Answer". Thanks, that works. But why do many code examples found on the internet simply use Response.Write()? How come they are able t...

Using Response.Write command...
Hi, I want to use Response.Write on page load to change the labels that appears in regular HTML files with another strings. how to?   Thanks, Gil Would you please elaborate more on your question?Beware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth) You should never use Response.Write to do that. It seems like you want to load some javascript. If so, use this: string script = @"document.getElementById('labelid').style=color='#88aaff';";ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "uniquekey&qu...

Designing the Layout using Response.Write
Hi I am new to asp.net development. I was wondering can we create a control in the Code Bedhind file rather than on the aspx file in the following way. sample.cs  1 StringBuilder html = new StringBuilder(); 2 3 html.Append("&lt;asp:Button id='btnSample' Text='Sample' Runat='Server' />"); 4 5 Response.Write(html.ToString());    Can We write a code like that I did but nothing is displayed in the form.I know it will work if we can create a place holder and create a Button control using the Button class...

Web resources about - Not able to use Response.write for writing to Excel, when using Response content compression - asp.net.web-forms

Compression (physical) - Wikipedia, the free encyclopedia
Physical compression is the result of the subjection of a material or structure to compressive stress , which results in reduction of volume ...

Sports science: Does compression gear benefit your workout?
&quot;No amount of compression can outdo a bad night's sleep or 22 vodka Red Bulls.&quot;

The Logic Pros: Time compression and pitch correction with Logic’s built-in Flex tools
In this week’s episode of the The Logic Pros , Flex audio features are up, with some serious hardware reviews on deck. Next week we will start ...

Reduce data usage, turn on data compression in Chrome – Android customization
The web browser can be a major data user on our devices, this Android customization post will show you how to turn on data compression in Chrome, ...

Opera Max Now Supports Data Compression For Netflix And YouTube Video
Opera Max has been out for a while, and it's been helpful to those who find themselves running low on data each billing cycle. This app uses ...

Google launches Brotli, a new open source compression algorithm to speed up the web
As websites and online services become ever more demanding, the need for compression increases exponentially. Fans of Silicon Valley will be ...

Stats for Chrome's Compression Proxy
A few Google engineers wrote an interesting paper ( PDF ) about Flywheel, Google Chrome's data compression proxy. The paper only talks about ...

China Mobile, Huawei and Qualcomm, Debut Uplink Data Compression on 4G Network
China Mobile, Huawei and Qualcomm, Debut Uplink Data Compression on 4G Network Cellular News China Mobile, along with Huawei and Qualcomm announced ...

Opera Mini browser for Android gets new data compression tech
The latest version for the mobile browser adds a new High compression mode that minimises data expenditure without affecting the page display. ...

Flickr's new image compression was almost invisible, until it wasn't
Ugh, it's all pixelated. Ugh, artifacts. Compression is otherwise a pretty useful trick for squeezing more stuff (photos, video and more) into ...

Resources last updated: 12/8/2015 3:00:06 PM