Hi,
I am not able to replicate the issue. I tried the following code and it
worked.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Dim control As UserControl =
CType(LoadContr ol("~/WebUserControl. ascx"), UserControl)
Me.form1.Contro ls.Add(control)
End Sub
In wEbuserControl. ascx,
I have put the button control.
Protected Sub Button1_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click
Response.Write( "test")
End Sub
Regards,
Manish
www.componentone.com
"רמי" wrote:
Hey,
I'm loading a webusercontrol dynamically using The following code:
Control newCtrl = LoadControl("My Ctrl.ascx");
newCtrl.ID = "MyCONTROL" ;
container.Contr ol.Add(newCtrl) ;
My webusercontrol has a server-side button and it I implemented its
OnClick event.
On the Init event of the Page, I re add the control on each post back.
And yet while pressing the button does postback, it doesn't wire my
events and the OnClick is never executed.
What am I missing?!
Thanks ahead
--sternr