Disappearing code lines

G

Guest

For the header on nearly all of our web pages, we're using a composite
control containing, among other items, a button to perform searches based on
criteria entered in other contained controls. Since individual controls
within composite controls aren't displayed when the composite is
dragged-and-dropped onto the page, the only way we have to instantiate an
event handler for the Search button.

Accordingly, we've typically added the line
this.SiteHeader1.Search += new EventHandler(SiteHeader1_Search);
to the InitializeComponent function.

InitializeComponent seems to be the only function within which we can
instantiate the event handler and it works great for a while, but now and
then, the IDE trashes the line. We haven't had any luck using the Page_Load
event, either.

Any ideas?

Regards,

Allen
 
J

jfleeson

Try putting it in the OnInit(...) event handler before the call to
InitializeComponent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top