How can I user binarywrite and frames?

  • Thread starter Thread starter Vinay
  • Start date Start date
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)
 
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
 
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
 
Back
Top