Bonjour,
Je suis complètement débutant (j'ai jamais écrit une ligne en asp) et j'ai un petit soucis avec un site. En fait au chargement de la page, le script lance une requête qui prend toute la table. Cela à bien sur pour effet de ralentir énormément l'application.
Voila le script en question :
<table border="0" cellpadding="4" cellspacing="4" style="width: 75%; font-family: 'Trebuchet MS';
height: 232px; color: gray;">
<tr>
<td style="width: 30%">
Nom :</td>
<td style="width: 70%">
<asp:TextBox ID="TbNom" runat="server" Font-Size="10pt" Height="20px" Width="94%" AutoPostBack="True"></asp:TextBox></td>
</tr>
<tr>
<td>
Adresse :</td>
<td>
<asp:TextBox ID="TbAdresse" runat="server" Font-Size="10pt" Height="20px" Width="95%" AutoPostBack="True"></asp:TextBox></td>
</tr>
<tr>
<td>
Ville :</td>
<td>
<asp:TextBox ID="TbVille" runat="server" Font-Size="10pt" Height="20px" Width="95%" AutoPostBack="True"></asp:TextBox></td>
</tr>
<tr>
<td>
Code Postal :</td>
<td>
<asp:TextBox ID="TbCP" runat="server" Font-Size="10pt" Height="20px" AutoPostBack="True" MaxLength="5"></asp:TextBox></td>
</tr>
<tr>
<td>
Référence :</td>
<td>
<asp:TextBox ID="TbRef" runat="server" Font-Size="10pt" Height="20px" AutoPostBack="True" MaxLength="10"></asp:TextBox></td>
</tr>
</table>
<br />
<asp:SqlDataSource ID="SqlCallBack" runat="server" ConnectionString="<%$ ConnectionStrings:DA_CallBackConnectionString %>"
SelectCommand="SELECT DISTINCT NumInterUnique, Nom, Adresse, CodePostal, Ville FROM CallBack WHERE (Nom LIKE '%' + @Nom + '%') AND (Adresse LIKE '%' + @Adresse + '%') AND (Ville LIKE '%' +
@Ville + '%') AND (CodePostal LIKE '%' + @CodePostal + '%') AND (NumInterUnique LIKE '%' + @NumInterUnique + '%')">
<SelectParameters>
<asp:ControlParameter ControlID="TbNom" DefaultValue="%" Name="Nom" PropertyName="Text" />
<asp:ControlParameter ControlID="TbAdresse" DefaultValue="%" Name="Adresse"
PropertyName="Text" />
<asp:ControlParameter ControlID="TbVille" DefaultValue="%" Name="Ville" PropertyName="Text" />
<asp:ControlParameter ControlID="TbCP" DefaultValue="%" Name="CodePostal" PropertyName="Text" />
<asp:ControlParameter ControlID="TbRef" DefaultValue="%" Name="NumInterUnique"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
Ce que j'aurais aimé faire c'est de mettre une condition pour vérifier si les champs TbNom, TbAdresse, TbVille, TbCP et TbRef ne sont pas vide
mais je ne sais pas si c'est possible ou comment c'est réalisable merci de m'aider.
@++