Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Tabstrip > Button Click Event not working on the Loaded Control
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Button Click Event not working on the Loaded Control

Feed from this thread
  • Shawn avatar

    Posted on Feb 17, 2011 (permalink)

    What I want to achieve is when I click on the tab of RadTabStrip then at that time load the pageview of the tab instead of loading all three tabs data at once.
    I solved this through the idea posted by one of your support person as described below.
    When user click the tab I load the control at the server side, code snippet is as below
    switch (args.Tab.Value)
           {
               case "Customer":
                   RadMultiPage1.PageViews[0].Controls.Clear();              
                   RadMultiPage1.PageViews[0].Controls.Add(LoadControl("~/CustomerDetailTab.ascx"));
                     
                   break;
               case "Product":
                   RadMultiPage1.PageViews[0].Controls.Clear();
                   RadMultiPage1.PageViews[0].Controls.Add(LoadControl("~/ProductDetailTab.ascx"));
                   break;
               case "Dealer":
                   RadMultiPage1.PageViews[0].Controls.Clear();
                   RadMultiPage1.PageViews[0].Controls.Add(LoadControl("~/DealerDetailTab.ascx"));
                   break;
           }


    Now the problem is my control(CustomerDetailTab.ascx) which is loaded has the button and the event against that button is not firing.When I click the button all the control disappear and in debugging control never go to the clicked event.
    What I am missing what should I need to do?




  • Yana Yana admin's avatar

    Posted on Feb 18, 2011 (permalink)

    Hello Shawn,

    Dynamically added controls as in your case don't preserve their state and should be added on every postback.

    All the best,
    Yana
    the Telerik team

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Tabstrip > Button Click Event not working on the Loaded Control