473,388 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Help with Response.Filter

i'm using creating a webpage on the fly that i save as an xls file to
be attached to an email and sent dynamically. i've got a custom
response filter class to write it out.

the problems start happening when i redirect - i need to somehow end
the response but not with Response.End because it doesn't allow it to
get to the Redirect statement and if i use something like
Response.Close or Response.Clear it outputs "Object moved to here" text
to the file instead of the page content.

here's the code:

Dim path As String = Server.MapPath(fileName)

Page.Response.Clear()
Page.Response.Write("<html><head></head><body>")

Response.ContentType = "application/ms-excel"

Response.AddHeader("Content-Disposition", _
"inline;filename=" & fileName)

MyBase.RenderChildren(writer)

'End the HTML document
Page.Response.Write("</body></html>")

Response.Filter = New ResponseFilter(Response.Filter, path)

Response.Redirect("SendEmail.aspx?savepath=" & path)

Jul 10 '06 #1
1 1498
i'm not sure whether it's a problem with Response.Redirect call
that's causing it or what...

oc****@gmail.com wrote:
i'm using creating a webpage on the fly that i save as an xls file to
be attached to an email and sent dynamically. i've got a custom
response filter class to write it out.

the problems start happening when i redirect - i need to somehow end
the response but not with Response.End because it doesn't allow it to
get to the Redirect statement and if i use something like
Response.Close or Response.Clear it outputs "Object moved to here" text
to the file instead of the page content.

here's the code:

Dim path As String = Server.MapPath(fileName)

Page.Response.Clear()
Page.Response.Write("<html><head></head><body>")

Response.ContentType = "application/ms-excel"

Response.AddHeader("Content-Disposition", _
"inline;filename=" & fileName)

MyBase.RenderChildren(writer)

'End the HTML document
Page.Response.Write("</body></html>")

Response.Filter = New ResponseFilter(Response.Filter, path)

Response.Redirect("SendEmail.aspx?savepath=" & path)
Jul 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
5
by: Rated R1 | last post by:
I wrote this before in the NGs, so I am going to paste the responses that I got and see if someone can please help me. Email me and we can set something up as Id even be willing to pay for your...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
3
by: Brad | last post by:
I have a response filter which injects "standard" html into my pages. The filter works fine when the initial stream is small enough not to buffer...or....if I have a large unbuffered stream (i.e. I...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
9
by: TF | last post by:
Hello all, I made a ASP.NET 2.0 site that shows possible "recipes" for paint colors stored in an access dbase. Basically, 1000 colors are stored with specific RGB values in separate columns. A...
0
by: mark r | last post by:
Hi there... im on with my shoutbox again only now i want to add a bad words filter. ive got the following code off a website and would appreciate someone showing me how to integrate it into my...
0
by: elliott | last post by:
Hello, I'm trying to use a C# IHttpModule to install a Response filter however IIS keeps removing the Content-Encoding header from the response; but all the other headers I set stay intact. ...
4
by: jrod11 | last post by:
I have an RSS reader that I have been using, but the only problem i have is that I want the target to be "_blank" rather than the parent window. Anyone know where I should add the _blank? ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.