Optimisation Requete UpdatePanel
Bonjour a tous.
J'ai une page d'un site asp.net assez complexe, qui peut contenir un tableau de plus de 1000 numeros.
Pour chaque numero j'ai assigné un bouton pour voir l'ensemble des details.
La page étant lourde + de 2 Mo, j'ai optimisé mon code en mettant de nombreux updatePanel.
En résultat, j'ai une page qui pour chaque action sur un numero prend 500 ms sous FF et 30 secondes sous IE.
Il semblerait que l'envoi en POST des données soit très très longue sous IE ce qui n'est pas le cas sous FF.
Comment pourrais-je diminer le temps d'attente sous IE.
Merci de vos précisions.
PS : Voici le code de ma page :
Code:
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePartialRendering="true" AsyncPostBackTimeout="30" />
<asp:UpdatePanel ID="UpdatePanelSelect" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<table border="0">
<tr>
<td>
Country :
</td>
<td style="width: 174px">
<asp:DropDownList ID="ddlCountry" runat="server" Width="174px" OnSelectedIndexChanged="ddlCountry_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
OcsSite :
</td>
<td>
<asp:DropDownList ID="ddlCity" runat="server" OnSelectedIndexChanged="ddlcity_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Range :
</td>
<td>
<asp:DropDownList ID="ddlRange" runat="server" OnSelectedIndexChanged="ddlRange_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ddlCountry" />
<asp:PostBackTrigger ControlID="ddlCity" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanelInfo" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<table border="0">
<tbody>
<tr>
<td>
City :
</td>
<td>
<asp:HiddenField ID="hiddenrangeId" runat="server"></asp:HiddenField>
<asp:Label ID="lblCity" runat="server" Text="">
</asp:Label>
-
<asp:Label ID="lblCountry" runat="server" Text="">
</asp:Label>
</td>
</tr>
<tr>
<td>
First number :
</td>
<td>
<asp:Label ID="lblStart" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td>
Last number :
</td>
<td>
<asp:Label ID="lblEnd" runat="server" Text=""></asp:Label>
</td>
</tr>
....INFORMATIONS...
<tr>
<td style="height: 58px">
Comment :
</td>
<td style="height: 58px">
<asp:TextBox ID="txtComment" runat="server" Width="271px" TextMode="MultiLine" Height="58px"></asp:TextBox>
</td>
</tr>
</tbody>
</table>
<asp:Button ID="btnUpdateComment" OnClick="btnUpdateComment_Click" runat="server"
Text="Update comment" Font-Size="Smaller" Width="119px"></asp:Button>
<br />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlRange" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="btnUpdateComment" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanelRange" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<div style="FLOAT: left; WIDTH: 510px">
<asp:DataList id="dlNumber" runat="server" OnSelectedIndexChanged="dlNumber_SelectedIndexChanged"
ShowFooter="False"
RepeatDirection="Horizontal"
RepeatColumns="10"
GridLines="Both"
BorderWidth="1px">
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanelNumber"
runat="server"
UpdateMode="Conditional"
ChildrenAsTriggers="false">
<ContentTemplate>
<asp:Label ID="lblnumber" runat="server" Text='<%# Eval("Number") %>' Visible="false">
</asp:Label>
<asp:Button ID="btn" runat="server" Text="" BorderWidth="0px" CommandName="Select"
CausesValidation="False" Width="40px" Enabled="false"/>
<asp:HiddenField ID="hiddenNumberid" runat="server" Value='<%# Eval("ObjectId") %>' />
<asp:HiddenField ID="hiddenState" runat="server" Value='<%# Eval("State") %>' />
</ContentTemplate>
<Triggers>
</Triggers>
</asp:UpdatePanel>
</ItemTemplate>
<ItemStyle Wrap="False"
HorizontalAlign="Center"
VerticalAlign="Middle">
</ItemStyle>
</asp:DataList>
</div>
<div style="FLOAT: right">
<asp:UpdatePanel id="UpdatePanelAction" runat="server" ChildrenAsTriggers="false"
UpdateMode="Conditional">
<ContentTemplate>
Number : <asp:Label id="lblNumberPanel" runat="server" Text="">
</asp:Label>
<BR />
State : <asp:Label id="lblStatePanel" runat="server" Text="">
</asp:Label>
<BR />
<BR />
<asp:Button id="btnAction1" onclick="btnAction" runat="server"
Text="Action" Visible="false" CausesValidation="False">
</asp:Button>
<asp:Button id="btnAct2" onclick="btnAction2" runat="server"
Text="" Visible="false" CausesValidation="False">
</asp:Button>
<BR />
<BR />
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlRange" EventName="SelectedIndexChanged">
</asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="dlNumbers" EventName="SelectedIndexChanged">
</asp:AsyncPostBackTrigger>
<asp:AsyncPostBackTrigger ControlID="btnAction" EventName="Click">
</asp:AsyncPostBackTrigger>
</Triggers>
</asp:UpdatePanel>
</DIV>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlRange" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel> |
Un bon gros pavé dans lequel on voit qu'il y a des imbrications de plusieurs updatePanels.
En effet je veux éviter que pour chaque clic sur un numéro; je dois recharger la page de 2Mo.
Or selon Firebug, tout semble correct mais Ie a de gros problème de performances.
Merci de vos retours