How can I user binarywrite and frames?

V

Vinay

Hi All:

I have a frameset (right and left). In the left frame I have a listbox that
contains items. When the user clicks on any one of these items (each item
points to either a word document or an image) - I'd like to show this (image
or word document) in the frame on the right. Would anyone have any ideas on
how I can do this? The code I currently have is:

I am trying to figure out what response.redirectlocation does - without much
luck.
Dim filename As String = "C:\temp\p.jpg"
Response.ContentType = "text/HTML"
Response.AddHeader("content-disposition", "attachment; filename=" & fn)
Dim adoStream As ADODB.Stream = Server.CreateObject("ADODB.Stream")
adoStream.Open()
adoStream.Type = 1
adoStream.LoadFromFile(fn)
Response.BinaryWrite(adoStream.Read())
adoStream.Close() : adoStream = Nothing
Response.End()

TIA

Vinay
(e-mail address removed)
 
N

Nicole Calinoiu

Vinay,

Since you haven't mentioned what your problem(s) you are encountering, I'm
going to guess that it's being caused by the declared content type. You
should be using the appropriate mime type for the actual content, and a jpg
is not of type text/HTML. Try using image/jpeg instead.

HTH,
Nicole
 
V

Vinay

Nicole:
Thanks for the input. What I'm trying to do is:

I have a frameset that has 2 pages (the one on the right and the one on the
left).
In the one on the left I have a button - when the user clicks this button I
want to use the binarywrite method to show the contents in the frame on the
right. If I were not using binarywrite I could use:
window.open (pagename.aspx), "_right"

How can I accomplish this using binarywrite?

TIA

Vinay
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top