Images are not getting displayed when using HTTPHandler

Discussion in 'ASP .Net' started by =?Utf-8?B?SGl0ZXNo?=, Apr 22, 2005.

  1. Hi,

    I am getting the response from another Website by using the HttpHandler in
    my current site. I am getting the page but all the images on that page are
    not appearing only placeholder are displayed.

    Can anybody know this issue and help me to resolve this.
    --
    Thanks
    Hitesh
     
    =?Utf-8?B?SGl0ZXNo?=, Apr 22, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?SGl0ZXNo?=

    Brock Allen Guest

    Open the rendered HTML, look for the <img> tags and it should be obvious.
    <img> tags require another request to the server to fetch the image at the
    URL specified in the src attribute. So in your handler, you'll need to parse
    the HTML you're getting back, find the <img> tags, make another request to
    get those, change the src rendered from your handler to come back into you,
    then dynamically serve up the bits of those images. This assumes the images
    aren't available at the original URLs, but it doesn't sound like they are.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Hi,
    >
    > I am getting the response from another Website by using the
    > HttpHandler in my current site. I am getting the page but all the
    > images on that page are not appearing only placeholder are displayed.
    >
    > Can anybody know this issue and help me to resolve this.
    >
     
    Brock Allen, Apr 22, 2005
    #2
    1. Advertising

  3. Hi Brock,

    Thanks for your suggestion and i have done the task in one more way let me
    discuss that with you and confirm that it will work always:

    See what i have done is while parsing the response i have replaced the src
    attribute of all the img tags by appending the "http:// + remote host name"
    to them and now its rendering the image also.

    So what do you think is this ok or it has some drawbacks in it ?

    and if you find anything wrong with it then it would be very helpful if you
    can give me some sample code of your approach, i am really wondering how
    should i write the code to get the images only once again and merge the two
    responses together?

    Thanks!

    "Brock Allen" wrote:

    > Open the rendered HTML, look for the <img> tags and it should be obvious.
    > <img> tags require another request to the server to fetch the image at the
    > URL specified in the src attribute. So in your handler, you'll need to parse
    > the HTML you're getting back, find the <img> tags, make another request to
    > get those, change the src rendered from your handler to come back into you,
    > then dynamically serve up the bits of those images. This assumes the images
    > aren't available at the original URLs, but it doesn't sound like they are.
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    > > Hi,
    > >
    > > I am getting the response from another Website by using the
    > > HttpHandler in my current site. I am getting the page but all the
    > > images on that page are not appearing only placeholder are displayed.
    > >
    > > Can anybody know this issue and help me to resolve this.
    > >

    >
    >
    >
    >
     
    =?Utf-8?B?SGl0ZXNo?=, Apr 25, 2005
    #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. =?Utf-8?B?SGl0ZXNo?=

    Images not getting rendered when using httphandler

    =?Utf-8?B?SGl0ZXNo?=, May 12, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    853
    =?Utf-8?B?SGVybWl0IERhdmU=?=
    May 13, 2005
  2. Stelios Skiathitis

    ASP.NET and Images not displayed!!

    Stelios Skiathitis, Jun 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    932
    Scott Allen
    Jun 7, 2005
  3. boney
    Replies:
    1
    Views:
    568
  4. Joe Reiss

    HttpHandler not getting called

    Joe Reiss, Jun 5, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    465
    PlatinumBay
    Jun 6, 2007
  5. Hitesh

    Getting access denied error on using HTTPHandler

    Hitesh, Apr 13, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    127
    Hitesh
    Apr 13, 2005
Loading...

Share This Page