Problem: Image Control again showing the same Image

Discussion in 'ASP .Net' started by Sandeep Singh Sekhon, Aug 2, 2006.

  1. I am developing an application in ASP.NET 1.1. on one page I allow the
    user to upload and delete the files to the server.
    When I delete the file, I physically delete the file from the location.
    Then I again prompt the user to load a new file but I save the file with
    the same name the earlier image file had been saved. The problem is that
    when I again upload the page through Response.Redirect after uploading,
    it is showing the same image it was showing before deletion whereas in
    that location on server, there is another image. How my view of the
    image in the Image Control will change when a new picture has come.


    Please give me any suggestion. All your suggestion are welcome.

    Thanks in advance

    Thanks,
    Sandeep S. Sekhon
     
    Sandeep Singh Sekhon, Aug 2, 2006
    #1
    1. Advertising

  2. Sandeep Singh Sekhon

    Winista Guest

    Either save the image with different name or append a unique id to image url
    for new upload.

    ImageUrl="MyImage.jpg?<GUID or something>

    "Sandeep Singh Sekhon" <> wrote in message
    news:...
    >I am developing an application in ASP.NET 1.1. on one page I allow the user
    >to upload and delete the files to the server.
    > When I delete the file, I physically delete the file from the location.
    > Then I again prompt the user to load a new file but I save the file with
    > the same name the earlier image file had been saved. The problem is that
    > when I again upload the page through Response.Redirect after uploading, it
    > is showing the same image it was showing before deletion whereas in that
    > location on server, there is another image. How my view of the image in
    > the Image Control will change when a new picture has come.
    >
    >
    > Please give me any suggestion. All your suggestion are welcome.
    >
    > Thanks in advance
    >
    > Thanks,
    > Sandeep S. Sekhon
     
    Winista, Aug 2, 2006
    #2
    1. Advertising

  3. Hi Sandeep,

    If the image file name doesn't change, even the image itself changes, the
    browser will use the image from cache. To force the browser use fresh copy,
    you can append something to the image url to make the browser think the url
    changes.

    myImageCtrl1.ImageUrl = "images/test.gif?id="+DateTime.Now.Ticks.ToString();

    Hope this helps. Please feel free to post here if anything is unclear.

    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Aug 3, 2006
    #3
  4. Hi Sandeep,

    I am interested in this issue. Would you mind letting me know the result of
    the suggestions? If you need further assistance, feel free to let me know.
    I will be more than happy to be of assistance.

    Have a great day!

    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Aug 7, 2006
    #4
    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. Mike Treseler
    Replies:
    3
    Views:
    2,393
  2. Rienk van der Scheer

    Re: Showing my ignorance of VHDL again...

    Rienk van der Scheer, Aug 4, 2003, in forum: VHDL
    Replies:
    0
    Views:
    915
    Rienk van der Scheer
    Aug 4, 2003
  3. Ray Booysen
    Replies:
    2
    Views:
    649
    Ray Booysen
    Mar 28, 2006
  4. luqman
    Replies:
    20
    Views:
    964
    Juan T. Llibre
    Jul 6, 2007
  5. Ò»Ê×Ê«

    A design problem I met again and again.

    Ò»Ê×Ê«, Apr 1, 2009, in forum: Python
    Replies:
    24
    Views:
    729
    Dennis Lee Bieber
    Apr 4, 2009
Loading...

Share This Page