How can I user binarywrite and frames?

Discussion in 'ASP .Net' started by Vinay, Oct 31, 2003.

  1. Vinay

    Vinay Guest

    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
    am
    Vinay, Oct 31, 2003
    #1
    1. Advertising

  2. 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


    "Vinay" <> wrote in message
    news:evvHr%23$...
    > 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
    > am
    >
    >
    >
    Nicole Calinoiu, Nov 1, 2003
    #2
    1. Advertising

  3. Vinay

    Vinay Guest

    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


    "Nicole Calinoiu" <> wrote in message
    news:ey%...
    > 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
    >
    >
    > "Vinay" <> wrote in message
    > news:evvHr%23$...
    > > 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
    > > am
    > >
    > >
    > >

    >
    >
    Vinay, Nov 7, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    503
    Bruce Barker
    Jun 21, 2005
  2. Vitaly Sedov
    Replies:
    0
    Views:
    447
    Vitaly Sedov
    Feb 14, 2006
  3. Philip
    Replies:
    3
    Views:
    958
    Karl Groves
    Jun 28, 2004
  4. Replies:
    1
    Views:
    993
    dorayme
    Feb 10, 2006
  5. Jens S0nderby Munk

    Problems with BinaryWrite, IE and Adobe Reader 6.0

    Jens S0nderby Munk, Aug 7, 2003, in forum: ASP General
    Replies:
    2
    Views:
    100
    Jens S0nderby Munk
    Aug 8, 2003
Loading...

Share This Page