c# - UserControl's Event Handler not firing -
I dynamically load a UserControl into a single view in a multiviz control. Although UserControl adds an event handler, the event never fire.
What am I missing here? Thanks!
ASPX page is included:
protected override zero operator (eventArgse E) {if (MultiVi 1.Active VIINDEX == 2) / / If the tab is selected, then Load Control {Control Presenter = Load Control ("Presenter.ascx"); (MultiView1.ActiveViewIndex.Views [2]. Add Control (Presenter);} base.OnPreRender (e);} Presenter.ascx.cs < / P>
Override protected Zero OnInit (EventArgs e) {Retry.Click + = this.Retry_Click; // This is a Net 2.0 project base.OnInit (e);} Safe void Retry_Click (Object Sender, EventArgs E) {// never fire}
I think it is not Firing because you are loading control of your page's prerendered event. On postback, control Being given because there is no visual status for it, so there is no control to fire its events. Try loading the control in the init event of the page let us know what happens!
< / Div>
Comments
Post a Comment