0

How do i create a file from page request

Lets say if i'm on Page A and need to have the file from Page B.

Page B returns a .XLS file format on the fly with response.output.

How do i get this as an File i need to attach this to an attachment i dont like

copy the whole code from Page B since i dont think thats realy needed.

ive tried a WebGetter but that does'nt realy works that well.

if you have any tips or snippets that would be awesome.

I code in VB.net.

Regards, Stefan

Dylan Corriveau
  • 2,561
  • 4
  • 29
  • 36
Stefan van de Laarschot
  • 2,154
  • 6
  • 30
  • 50
  • Pages should not return files. You should use an [HTTP Handler](https://msdn.microsoft.com/en-us/library/bb398986(v=vs.140).aspx) or [Generic Handler](http://www.dotnetperls.com/ashx). Also see [.aspx vs .ashx MAIN difference](http://stackoverflow.com/questions/5469491). – mason Jun 01 '15 at 13:54
  • 1
    That why [SoC](http://en.wikipedia.org/wiki/Separation_of_concerns) is important. If all your xls generation code was out of the UI and in a class, than Page A could just call a function to get the document. – the_lotus Jun 01 '15 at 14:00

0 Answers0