Problem: Image Control again showing the same Image

  • Thread starter Sandeep Singh Sekhon
  • Start date
S

Sandeep Singh Sekhon

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
 
W

Winista

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

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

Walter Wang [MSFT]

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 ([email protected], 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.
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top