How to raise event in user control webpart...
I build an usercontrol.In that usercontrol, I build an event.When I drop that usercontrol in webzone in a webpart page, it can raise event.But when I add usercontrol to webzone at runtime (usercontrol wrapped by GenericWebpart class), I can't raise event in that usercontrol. Can you help me?
MyUserControl myUserCtrl= (MyUserControl)this.LoadControl("MyUserControl.asc x");
myUserCtrl.ID = "myUserCtrl";
//register for event but I can't raise event ???
//add to webzone by wrapped by generic webpart object
GenericWebPart webpart = this.MyWebManager.CreateWebPart(myUserCotrol);
webpart.Title = "Test";
this.MyWebManager.AddWebPart(webpart, wpZone1, 0);
public void OnHandleFunction(object sender,EventArgs e)
....//it's not ok