Bonjour,



Je rencontre un souci concernant l’actualisation d’une image (<asp:image />) sous Internet Explorer par l’intermédiaire d’un UpdatePanel.

En effet tout fonctionne correctement sous Firefox mais pas sous IE, je pense que le problème vient du fait que l’image est stockée en cache ! Si par exemple j’appuie sur F5 pour recharger la page entière, l’image est actualisée mais je perds toutes les données de mon formulaire !



Voici mon code :



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<asp:Timer ID="TimerPhoto" Enabled="true" Interval="5000" runat="server" 
 
    ontick="TimerPhoto_Tick">                  
 
</asp:Timer>        
 
 
 
<ajaxToolkit:AsyncFileUpload OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" runat="server" ID="AsyncFileUpload1" Width="250px" UploaderStyle="Traditional" UploadingBackColor="#CCFFFF" ThrobberID="myThrobber" />
 
&nbsp;
 
<asp:UpdatePanel ID="UpdatePanelPhoto" runat="server" UpdateMode="Conditional">
 
    <ContentTemplate>         
 
        <asp:Label runat="server" ID="myThrobber" style="display:none;" ><img align="middle" alt="" src="../images/uploading.gif" /></asp:Label>
 
        <asp:Label runat="server" Text="&nbsp;" ID="uploadResult" />
 
        <table style="border-collapse: collapse; border-left: solid 1px #aaaaff; border-top: solid 1px #aaaaff;" runat="server" cellpadding="3" id="clientSide" width="250px" />
 
 
 
        <asp:Image ID="ImagePhoto2" runat="server" Width="250px" /> 
 
    </ContentTemplate>
 
</asp:UpdatePanel> 
 
 
 
protected void TimerPhoto_Tick(object sender, EventArgs e)
 
{
 
            ImagePhoto2.ImageUrl = "~/Vendangeurs/DisplayImg.ashx?Byte=OK";
 
            UpdatePanelPhoto.Update();
 
}
 
 
 
void AsyncFileUpload1_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
 
{
 
            bytesPhoto = AsyncFileUpload1.FileBytes;
 
            ImagePhoto2.ImageUrl = "~/Vendangeurs/DisplayImg.ashx?Byte=OK";
 
}


J’ai bien essayé de mettre :

->ceci dans le web.config :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
<httpModules>
 
      <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
 
      <add name="Session" type="System.Web.SessionState.SessionStateModule" />
 
</httpModules>


->ou ceci dans le <head> de ma page :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
<head runat="server">
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 
<meta http-equiv="cache-control" content="no-cache" />
 
<meta http-equiv="pragma" content="no-cache" />
 
<meta http-equiv="expires" content="-1" />
 
</head>


Rien y fait auriez-vous une idée ?



Merci