Bonjour,
J'ai un formulaire de recherche de personne, avec nom, prenom, date de naissance etc.
J'ai mis en place les AutoCompleteExtender sur chaque champ avec succès.
<asp:TextBox ID="TextBoxRechercheNom" runat="server"></asp:TextBox>
<atlas:AutoCompleteExtender runat="server" ID="AutoCompleteExtenderRechercheNom" >
<atlas:AutoCompleteProperties Enabled="true" MinimumPrefixLength="3" TargetControlID="TextBoxRechercheNom" ServiceMethod="GetFilteredListRechercheNom" ServicePath="FilterServiceRecherche.asmx" />
</atlas:AutoCompleteExtender>
[WebMethod]
public string[] GetFilteredListRechercheNom(string prefixText, int count)
{
using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["base"].ConnectionString))
{
using (SqlCommand command = new SqlCommand("GetFilterRechercheNom", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new SqlParameter("@Nom", prefixText));
connection.Open();
ArrayList items = new ArrayList();
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
items.Add((string)reader["nom_membre"]);
}
}
return (string[])items.ToArray(typeof(string));
}
}
}
Mais il y a une dépendance entre chacun de ses champs.
Quand tu as saisi un nom, faudrait pouvoir le prendre en compte lors de l'autocompletion des prenoms.
Est-ce possible ?
Merci.