Bonsoir Tout le monde

J'ai une page ASP.NET avec un code qui génère une mise en page avec des controles dynamiques, des ASP Panel et des Labels.
Le problème qui se pose que des que je tente d'utiliser un controle ASP checkbox le compilateur génère une erreure : le controle Checkbox devrait être utilisé avec une balise runat = server. et ça soule depuis qque temps

j'ai essayé de mettre les checkbox dans la balise form1 mais ça change le design.

voilà mon code

le css

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
 
 
.Main
{
    width:800px;
    height:4200px;
    margin:auto;
}
 
 
.logo
{
    width:800px;
    height:35px;
    background-image:url(images/quizban.png);
    background-repeat:no-repeat;
}
 
.Quizzpanel
{
    width:780px;
    height:160px;
    margin:auto;
    border:solid 2px #339933;
    padding:5px 5px 5px 5px;
    margin-bottom :5px;
}
 
.headerpanel
{
    width:680px;
    background-color:#339933;
    height:30px;
    margin:auto;
    margin-bottom:5px;
}
 
.QuestionPanel
{
    width:680px;
    height:60px;
    background-color:#99FF99;
    margin :auto;
    margin-bottom:5px;
    padding :5px 5px 5px 5px;
}
 
.resultPanel
{
    width:680px;
    height:70px;
    border:solid 1px #336600;
    margin :auto;
    padding :5px 5px 5px 5px;
    background-color :#009900;
}
 
.creation
{
    width:800px;
    height:30px;
    margin:auto;
}
 
.creationLabels
{
    font-family :Cambria ;
    font-size :large ;
    color :Black ;
}
 
 
.Qlabeltext
{
    font-family :Cambria ;
    font-size :16px;
    color:Olive ;
}
 
.Rlabeltext
{
 font-family :Cambria ;
 font-size :14px;
 color:white ;
}
 
.checkboxes
{
    padding :5px 5px 5px 5px;
}

le code générateur en bref

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
 
 Dim QuizzPanel As New Panel
 Dim QuestPanel As New Panel
 Dim QuestionText As New Label
 Dim ResultPanel As New Panel
 
 
  For count = 0 To QuizzInfoObj.nQuestion - 1
 
Dim QuizzPanel As New Panel
Dim QuestPanel As New Panel
Dim QuestionText As New Label
Dim ResultPanel As New Panel
 
QuizzPanel.CssClass = "Quizzpanel"
QuestPanel.CssClass = "QuestionPanel"
QuestionText.CssClass = "Qlabeltext"
ResultPanel.CssClass = "resultPanel"
 
QuestionText.Text = QuizzTextobj.QuestionText
 
QuestPanel.Controls.Add(QuestionText)
QuizzPanel.Controls.Add(QuestPanel)
QuizzPanel.Controls.Add(ResultPanel)
 
 
Dim innercounter As Integer = 0
 
  Dim ReplyText As New Label
 
                        QuizzAnswerObj = AnswersArrayList.Item(innercounter)
 
                        ReplyText.Text = QuizzAnswerObj.AnswerText
 
 
 
 
                        ReplyText.CssClass = "Rlabeltext"
                        ResultPanel.Controls.Add(form1)
 
 
                        Dim MultipleChoiceCheckBox As New CheckBox
 
                        form1.Controls.Add(MultipleChoiceCheckBox)
 
 
                        ResultPanel.Controls.Add(ReplyText)
 
 
                    Next
dans le code ci - dessus le code génère les checkbox mais il met les 8 dans la même place sans suivre l'itération. regardez la photo




merci