Solved

ASP.NET DataGrid Image does not Refresh after Edit Mode

Posted on 2004-09-13
3
218 Views
Last Modified: 2012-06-21
Thanks to other EE users I was able to add image uploading to my datagrid. However now when it goes back after the edit (new image uploaded) it shows the original image and not the new one unless I hit f5 and refresh the browser.

How can I fix this?

I'm using the following in the PageLoad sub and it calls the database and loads the new info into the datagrid.

If Not IsPostBack Then
    BindDataGrid()
End If
0
Comment
Question by:brian2k1
  • 2
3 Comments
 
LVL 7

Expert Comment

by:mantarae
ID: 12043287
After the edit takes place (ie, in your edit_command function), you need to call BindDataGrid() again.   Do not put it in the Page_Load function, otherwise the grid would be rebound before your edit is saved.
0
 
LVL 1

Author Comment

by:brian2k1
ID: 12072014
No. It updates fine. It's the IMAGES being displayed that do not refresh. I guess my question is how can I force the browser to update the images or disable their cache for the page.
0
 
LVL 7

Accepted Solution

by:
mantarae earned 500 total points
ID: 12135563
Oops...misread your question (and was out of town).   Try this:

Launch the Internet Services Manager, navigate to the images directory in question, then right-click the folder, and choose Properties. In the Properties dialog box, select HTTP Headers, and then click Add. Enter the following three headers:

cache-control:no-cache
pragma:no-cache
expires:0

from:
http://www.developerfusion.com/show/228/
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now