Bonjour,
j ai un petit soucis concernant des DDL et TBX.
J ai toujours aujouter des textbox et ddl avec le toolbox.
maintenant je veux faire un formulaire qui se génère tout seul et qui ajoute des DDL et TBX en fonction de certains criteres, et donc un certain nombre different.
donc voici la partie de mon code ou j ajoute les DDL
while (PartReader.Read())
{
Label lab_num = newLabel();
lab_num.Text = i + "] " + PartReader.GetValue(0).ToString();
lab_num.Font.Bold = true;
Controls.Add(lab_num);
Controls.Add(newLiteralControl("<br/>"));
Controls.Add(newLiteralControl("<br/>"));
i++;
// to put the option
if (PartReader.GetValue(1).ToString() == "True")
{
Label lab_state = newLabel();
lab_state.Text = "State: ";
Controls.Add(lab_state);
Controls.Add(newLiteralControl("<br/>"));
DropDownList ddlState = newDropDownList();
ddlState.ID = "DDL_STATE";
//ddlState.AutoPostBack = true;
Controls.Add(ddlState);
Controls.Add(newLiteralControl("<br/>"));
}
}
Je reçois alors comme message d erreur:
Control 'DDL_STATE' of type 'DropDownList' must be placed inside a form tag with runat=server.
est ce que quelqu un peut m expliquer comment rajouter runat=server.!
merci
Sabine