Bonjour,
je crée un control composite qui contient 2 boutons (btOpen et btClose)
l'un pour demander l'affichage du contenu d'un tableau inclu ds le composite
l'autre pour masquer ce tableau.
je compile
j'ouvre un projet web et je l'insère ds une page web.
qd je clique, je n'accede pas à la méthode btOpen_Click.
qd la page se recharge, à quel moment je peux récupérer l'action Click sur le bouton de mon control composite ?
j'espère que je suis assez clair
Merci de votre aide ou indications
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 public class myControl : WebControls, INamingContainer { private Boolean flagVisible = false; protected override void CreateChildControls() { imgbtnOuvre = new ImageButton(); imgbtnOuvre.Click += new ImageClickEventHandler(this.imgbtnOuvre_Click); if (flagVisible) { TextBox myTextBox = new TextBox(); this.Controls.Add(myTextBox); } } private void imgbtnOuvre_Click(object sender, ImageClickEventArgs e) { flagVisible = true; }
Partager