Response.contenttype not working ???

  • Thread starter Thread starter Adrian Turner
  • Start date Start date
A

Adrian Turner

The following code just outputs to the browser, I want it to download and I
dont understand why it doesnt work....

Sub Page_Load(Sender As Object, E As EventArgs)
Page.EnableViewState=False
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-Disposition","attachment; filename=test.xls")
Response.write("Adrian")
Response.end()
end sub

Very annoying, should be simple. Any help would be appreciated.

Ade
 
The following code just outputs to the browser, I want it to download andI
dont understand why it doesnt work....

Sub Page_Load(Sender As Object, E As EventArgs)
 Page.EnableViewState=False
 Response.Clear()
 Response.ContentType = "application/vnd.ms-excel"
 Response.AddHeader("Content-Disposition","attachment; filename=test.xls")
 Response.write("Adrian")    
 Response.end()
end sub

Very annoying, should be simple. Any help would be appreciated.

Ade

For me it works. It must be a cache in your browser
 
Back
Top