[CodeBlog] ASP.NET server controls not getting events from child controls? - by simon at Sat, 04 Jul 2009 21:09:33 GMT
My ASP.NET server/composite controls were not getting events from child controls, but only on the real pages, they worked fine on test ones. It turned out that I had a master page enabled but didn't have an ID set for it, so it was auto generating it.
Just add this to your master pages code file:-
protected override void OnInit(EventArgs e) { base.OnInit(e); this.ID = "SomeName"; }
And child controls will start working as expected. I don't often do web development so this stumped me for quite a while...
Permalink
Copyright © 2001-2024 Simon Soanes