Response.contenttype not working ???

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
 
G

Guest

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top