Solved

ASP.NET DataGrid Image does not Refresh after Edit Mode

Posted on 2004-09-13
3
221 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Scheduled IIS .Net2 AppPools recycle and SQL connection Hangs 33 146
JS does not refresh 6 38
CREATE DATABASE 3 34
Want an individual results display div 8 40
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

713 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