MS Toolbar control freezes

T

theintrepidfox

Dear Group

When I call the code below within the click event of a MS Toolbar
control, the code is executed and works fine but the Toolbar freezes.
When calling the same code from a webform button, everything works
fine. Is there any explanation for this behaviour?

Thanks very much for your help & efforts!

Martin

'Set Headers
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/x-msdownload"
Response.AppendHeader("Content-Disposition",
"attachment;filename=Test.doc")
'Create Stream
Dim FileStream As System.IO.FileStream = New
System.IO.FileStream("C:\Inetpub\wwwroot\WebApplication3\progclient\1\assets\files\documents\key\2212005210406_1_1.doc",
System.IO.FileMode.Open)
Dim FileSize As Long = FileStream.Length
Dim bBuffer(FileSize) As Byte
FileStream.Read(bBuffer, 0, Convert.ToInt32(FileSize))
FileStream.Close()
'Output To Client
Response.BinaryWrite(bBuffer)
Response.End()
 

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,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top