Refresh image in asp:Image-control

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlybw==?=, Feb 27, 2007.

  1. Hello!

    I've seen a lot of post about this but every one of them ends up with the
    same solution:

    Set:

    Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
    past....
    Response.Cache.SetCacheability(HttpCacheability.NoCache);

    and use:
    myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks

    or something like that. This has worked for me too, until now. One customer
    can't get the picture to refresh. I've checked that the image-file changes on
    the server and that the src value of the img-tag in the page is different.
    Everything changes as it should except the image. How can I force it to show
    the right image?

    Thanks!
     
    =?Utf-8?B?TWlybw==?=, Feb 27, 2007
    #1
    1. Advertising

  2. > or something like that. This has worked for me too, until now. One
    > customer
    > can't get the picture to refresh. I've checked that the image-file changes
    > on


    Have you checked the customer's client settings for cache?
    Is it, accidently, set to "Never lookup data on network" (always use cache)?


    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com
    www.edujini-labs.com
    http://eduzine.edujini-labs.com
    -----------------------------------------
     
    MasterGaurav \(www.edujini-labs.com\), Feb 27, 2007
    #2
    1. Advertising

  3. Hi,
    try appending a random number to the image url.

    For example,

    string url = string.format(imagepath.gif?r={0}, rnd()*10000)

    Hopefully this has helped you.
    --
    Thanks and Regards.
    Manish Bafna.
    MCP and MCTS.



    "Miro" wrote:

    > Hello!
    >
    > I've seen a lot of post about this but every one of them ends up with the
    > same solution:
    >
    > Set:
    >
    > Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
    > past....
    > Response.Cache.SetCacheability(HttpCacheability.NoCache);
    >
    > and use:
    > myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks
    >
    > or something like that. This has worked for me too, until now. One customer
    > can't get the picture to refresh. I've checked that the image-file changes on
    > the server and that the src value of the img-tag in the page is different.
    > Everything changes as it should except the image. How can I force it to show
    > the right image?
    >
    > Thanks!
     
    =?Utf-8?B?TWFuaXNoIEJhZm5h?=, Feb 27, 2007
    #3
  4. Where can you find this setting? I connected my computer to their network and
    tried it with the same result so I guess it's not an issue with Internet
    Explorer settings.

    "MasterGaurav (www.edujini-labs.com)" wrote:

    > > or something like that. This has worked for me too, until now. One
    > > customer
    > > can't get the picture to refresh. I've checked that the image-file changes
    > > on

    >
    > Have you checked the customer's client settings for cache?
    > Is it, accidently, set to "Never lookup data on network" (always use cache)?
    >
    >
    > --
    > Happy Hacking,
    > Gaurav Vaish | www.mastergaurav.com
    > www.edujini-labs.com
    > http://eduzine.edujini-labs.com
    > -----------------------------------------
    >
    >
    >
     
    =?Utf-8?B?TWlybw==?=, Feb 27, 2007
    #4
  5. Thanks!

    I'll try that but I doubt it makes any difference. Using the Ticks value in
    the imageurl also gives a different number each time. I've even controlled it
    on the client.

    Regards

    "Manish Bafna" wrote:

    > Hi,
    > try appending a random number to the image url.
    >
    > For example,
    >
    > string url = string.format(imagepath.gif?r={0}, rnd()*10000)
    >
    > Hopefully this has helped you.
    > --
    > Thanks and Regards.
    > Manish Bafna.
    > MCP and MCTS.
    >
    >
    >
    > "Miro" wrote:
    >
    > > Hello!
    > >
    > > I've seen a lot of post about this but every one of them ends up with the
    > > same solution:
    > >
    > > Set:
    > >
    > > Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
    > > past....
    > > Response.Cache.SetCacheability(HttpCacheability.NoCache);
    > >
    > > and use:
    > > myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks
    > >
    > > or something like that. This has worked for me too, until now. One customer
    > > can't get the picture to refresh. I've checked that the image-file changes on
    > > the server and that the src value of the img-tag in the page is different.
    > > Everything changes as it should except the image. How can I force it to show
    > > the right image?
    > >
    > > Thanks!
     
    =?Utf-8?B?TWlybw==?=, Feb 27, 2007
    #5
  6. It could actually be their network provider. Keep in mind, some providers
    still have proxy servers that cache files to save on bandwidth. AOL used to
    be horrible at this, even caching whole web sites and displaying some that
    were days old.

    Chances are, if it's happening on their network the network admin has made a
    setting somewhere on their domain controller or it has something to do with
    their network connection to the internet and a setting on a proxy server or
    router.

    --

    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006

    "Miro" <> wrote in message
    news:...
    > Where can you find this setting? I connected my computer to their network
    > and
    > tried it with the same result so I guess it's not an issue with Internet
    > Explorer settings.
    >
    > "MasterGaurav (www.edujini-labs.com)" wrote:
    >
    >> > or something like that. This has worked for me too, until now. One
    >> > customer
    >> > can't get the picture to refresh. I've checked that the image-file
    >> > changes
    >> > on

    >>
    >> Have you checked the customer's client settings for cache?
    >> Is it, accidently, set to "Never lookup data on network" (always use
    >> cache)?
    >>
    >>
    >> --
    >> Happy Hacking,
    >> Gaurav Vaish | www.mastergaurav.com
    >> www.edujini-labs.com
    >> http://eduzine.edujini-labs.com
    >> -----------------------------------------
    >>
    >>
    >>
     
    Mark Fitzpatrick, Feb 27, 2007
    #6
  7. =?Utf-8?B?TWlybw==?=

    Joerg Jooss Guest

    Thus wrote Miro,

    > Hello!
    >
    > I've seen a lot of post about this but every one of them ends up with
    > the same solution:
    >
    > Set:
    >
    > Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in
    > the
    > past....
    > Response.Cache.SetCacheability(HttpCacheability.NoCache);
    > and use:
    > myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks
    > or something like that. This has worked for me too, until now. One
    > customer can't get the picture to refresh. I've checked that the
    > image-file changes on the server and that the src value of the img-tag
    > in the page is different. Everything changes as it should except the
    > image. How can I force it to show the right image?


    None of those is a solution if your images are served by IIS directly. Is
    this the case here?

    --
    Joerg Jooss
     
    Joerg Jooss, Feb 27, 2007
    #7
    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. brian lanning
    Replies:
    0
    Views:
    635
    brian lanning
    Jul 29, 2003
  2. Sunit Joshi

    Image control does not refresh

    Sunit Joshi, Oct 30, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    600
    Suresh
    Oct 30, 2003
  3. Per Magnus L?vold
    Replies:
    1
    Views:
    5,219
    John C. Bollinger
    Oct 8, 2004
  4. Pkenty
    Replies:
    0
    Views:
    439
    Pkenty
    May 28, 2004
  5. Jawahar Rajan
    Replies:
    1
    Views:
    313
    Adrienne
    Oct 1, 2003
Loading...

Share This Page