Help with Response.Filter

O

ocbka1

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)
 
O

ocbka1

i'm not sure whether it's a problem with Response.Redirect call
that's causing it or what...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top