• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

ASP.NET DataGrid Image does not Refresh after Edit Mode

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
brian2k1
Asked:
brian2k1
  • 2
1 Solution
 
mantaraeCommented:
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
 
brian2k1Author Commented:
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
 
mantaraeCommented:
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

Technology Partners: 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!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now