using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Recherche_PlusieursCategories : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void BTchercher_Click(object sender, EventArgs e) { string filtre = ""; string listeNombre = ""; foreach (ListItem li in CBLCategories.Items) { if (li.Selected) { if (listeNombre != "") { listeNombre += ","; } listeNombre += li.Value.ToString(); } } if (listeNombre != "") { filtre += "categoryid in (" + listeNombre + ")"; } if (filtre != "" ||TextBox1.Text != "" || TextBox2.Text != "") { filtre += " and unitprice >= " + TextBox1.Text + " and unitprice <= " + TextBox2.Text; } else if (TextBox1.Text != "" || TextBox2.Text != "") { filtre += "unitprice >= " + TextBox1.Text + " and unitprice <= " + TextBox2.Text; } DSProduits.FilterExpression = filtre; } }