When adding controls dynamically you will need to make sure that these are re-created after each post back.
There is a difference between declaring controls in the .aspx file and adding them programmatically from code behind:
When the controls are added declaratively then all the controls are there on future postbacks, because on every postback request ASP.NET Webforms recreates the state of the page using the declarations in the designer and the data from the Viewstate and from the posted form.
When the controls are addded programmatically then ASP.NET will try to do the same: recreate the state of the page on the server using the declarations in the .aspx file + ViewState + posted form. It does not have a way of knowing that you've modified the Controls hierarchy and that you've added or removed some controls, because these changes are not tracked in any way between postbacks. That is why you will need to recreate the expected hierarchy on every postback.
You will need to re-run your code that adds controls on the Page_Init event. This is important, because after this event ASP.NET will try to bind state information from the ViewState and from the posted data to the control hierarchy, that now will contain your dynamic controls. If you don't do this, you will still have your controls but you won't be able to retrieve the data posted by the user on those controls.
Here is how your code could look like:
public void Page_Init(object sender, EventArgs e){
CreateDynamicControls();
}
public void CreateDynamicControls(){
HtmlGenericControl span = new HtmlGenericControl("span");
DropDownList ddlList = new DropDownList();
TextBox txtValeur = new TextBox();
Button btnAdd = new Button();
ListItem item1 = new ListItem("No. Projet", "no");
ListItem item2 = new ListItem("Désignation Projet", "desi");
ListItem item3 = new ListItem("Chef de Projets", "chef");
span.Style.Add(HtmlTextWriterStyle.Color, "Black");
span.InnerText = "Filtre " + (i + 1).ToString() + " : ";
ddlList.ID = "ddlFiltreProjets" + (i + 1).ToString();
ddlList.Items.Add(item1);
ddlList.Items.Add(item2);
ddlList.Items.Add(item3);
txtValeur.ID = "txtValeurFiltreProjets" + (i + 1).ToString();
txtValeur.ForeColor = System.Drawing.Color.Black;
btnAdd = btnAddFiltre1;
divChampsFiltrageProjetsTest.Controls.Add(span);
divChampsFiltrageProjetsTest.Controls.Add(ddlList);
divChampsFiltrageProjetsTest.Controls.Add(txtValeur);
divChampsFiltrageProjetsTest.Controls.Add(btnAdd);
}
You can find more info on MSDN, on the ASP.NET Page Life Cycle article.