By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,369 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,369 IT Pros & Developers. It's quick & easy.

Help with Response.Filter

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.