*****************************

Visual Studio 2003
Windows XP 2000
C#
*****************************

Crétion Dynamique Button avec gestion événement



Création d'un button dans une page ASP,mais je trouve un problème c'est quand je clique sur OK ,la fonction Bok_Click
ne s'execute pas ,si vous pouvez m'apporter votre aide et merci.

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
 Button    Bok = new Button() ;
 
   Bok.Text = "OK";
   Bok.Width = 60;
   Bok.Height = 60;
   //////
 Bok.Click += new EventHandler(Bok_Click);
 
   //////
   Panel1.Controls.Add(Bok);
 
		}
		//////////////////////////////
	void Bok_Click(object sender, EventArgs e)
            {  
 
	        Response.Write("OKKK");
	    }