我在页面上有嵌套控件。前任:
Page
-ChildControl1 (of type AllOfMyItems)
-ChildControl2 (of type ListOfItems)
-ChildControl3 (of type MyItem <- this one fires event)
当子控件引发事件时,我希望页面处理该事件。有什么好方法可以做到这一点?
在这里使用事件和代表似乎是个好主意。
所以我试图在我的页面的 Page_Init 上执行以下操作:
MyItem.SomethingHappened += doStuff();
什么是这样做的好方法?