Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: SV: RE: control events


Message #1 by "Einar Paul Qvale" <einar.paul.qvale@f...> on Fri, 6 Dec 2002 18:15:15 +0100
Are you adding the control and setting the event in the InitializeComponent function?
 
Must be done every round trip to the server, don't check for IsPostBack.

	-----Opprinnelig melding----- 
	Fra: Adabie, Judy [mailto:jadabie@b...] 
	Sendt: fr 06.12.2002 04:47 
	Til: ASPX_Professional 
	Kopi: 
	Emne: [aspx_professional] RE: control events
	
	

	This compiles fine but it never goes to the event when the button is
	pressed.  All the code is in a class that is used by a page. 
	
	
	-----Original Message-----
	From: Einar Paul Qvale [mailto:einar.paul.qvale@f...]
	Sent: Thursday, December 05, 2002 4:36 PM
	To: ASPX_Professional
	Subject: [aspx_professional] RE: control events
	
	
	                ImageButton IB = new ImageButton();
	                IB.Click += new
	System.Web.UI.ImageClickEventHandler(IB_clicked);
	
	                protected void IB_clicked(object sender,
	System.Web.UI.ImageClickEventArgs e)
	                {
	                }
	
	You should probably add the control in the Page_Init function
	
	-----Original Message-----
	From: Adabie, Judy [mailto:jadabie@b...]
	Sent: 5. desember 2002 05:35
	To: ASPX_Professional
	Subject: [aspx_professional] control events
	
	
	How can I access the events for a server control that was created in
	code. Such as accessing the Click event for the ImageButton created
	below:
	                        ImageButton IB;
	                        IB = new ImageButton;
	                        IB.ID = "myImageButton";
	                        Controls.Add(IB);
	Thanks!
	
	
	
	
	
	



  Return to Index