bri189a Posted June 22, 2004 Posted June 22, 2004 (edited) I'm working on a custom control, a wysiwyg editor (which I'm going to give out freely on this site), and like all wysiwyg editors the actual text is stored in a hidden field. I have everything coming along nicely but my child control that a set up an event for isn't registring: In a normal form: <input id="test" runat="server" value="asdf" type="text"> If you set up a ServerChange event for that will fire when you change the value, just like on a regular TextBox control, the event is similiar for a hidden input. The problem is that I have an instance of this control in the children controls of my custom control and an event set up: test = new HtmlInputText(); test.ID = "test"; test.ServerChange += new EventHandler(test_ServerChange); Controls.Add("test"); but the event never fires even when a change is made...why? How can I get an object to fire an event? Edited June 22, 2004 by bri189a Quote
bri189a Posted June 22, 2004 Author Posted June 22, 2004 The answer is that you have to implement the INamingContainer interface is your custom control. This allows for those child controls to be unique, thus have events tied to them. It was buried deep within MSDN, but I found it! Quote
Moderators Robby Posted June 23, 2004 Moderators Posted June 23, 2004 Or you could've asked me. :) :) Quote Visit...Bassic Software
bri189a Posted June 28, 2004 Author Posted June 28, 2004 Or you could've asked me. :) :) Don't worry; I'll ask you plenty as time goes by :) :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.