Visual Basic .NET » Windows Registry and File I/O
Help with Response.Filter -- masterslave --


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)

[Submit Comment]Home