Image not changed after update
Posted on 2010-11-11
My web application is asp.net +vb.net with master page,the problem is when i change the image in a certain page with another one but with the same ImageUrl I don't get the updated image, instead i keep getting the old image,only when i delete the history,temp and data of the browser (IE) from Tools\Internet Option\..) or after some time I get the updated image.
this is my code:
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
If e.CommandName.ToLower() = "viewd" Then
Dim lb As LinkButton = CType(e.CommandSource, LinkButton)
Dim gvRow As GridViewRow = lb.BindingContainer 'Getting current row to get index
Dim strKey As String = GridView1.DataKeys(gvRow.RowIndex)(0).ToString()
Dim NewsBody As TextBox = CType(gvRow.Cells(1).FindControl("NewsBody"), TextBox)
PopPanel.Visible = True
Image1.ImageUrl = "~/NewsImages/Images/" + strKey + ".jpg"
details.Text = NewsBody.Text
Appreciate your help.