Click here to Skip to main content
14,237,394 members
Rate this:
Please Sign up or sign in to vote.
See more:
Does anybody knows how can I apply Response on my class.vb?

Im planning to add download on

I'm stock with the error "Response is not available in this context"

Response.ContentType = "Application/xmsexcel"
Response.AppendHeader("Content-Disposition", "attachment; filename=Excel.xls")
Orcun Iyigun 5-Apr-13 3:00am
Can this link[^] be a solution to your question? 5-Apr-13 3:18am
Yes it is thanks for the reply :) 5-Apr-13 3:21am
wonder how Can I apply it with this code..

rpt.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.Excel, Response, True, "Excel")
keeps saying thread aborted

this was the my code before and then I change it with the above code..

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Response is only available on your page behind code page not in the class file cause Response object is returned by server with respect to the server request.

Class files are not requested to the server so you cant get the response on your class file .

It only possible on your Page behind .
Comments 5-Apr-13 20:49pm
Thanks for the reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100