Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
Can you dynamically add a UserControl to a WebTab
posted

Is it possible to dynamically add a UserControl to a WebTab? I can dynamically add a built in control like a textbox to the ContentPane, but I can't seem to get it to work with a UserControl.

 Any thoughts?
Dale

Parents
No Data
Reply
  • 175
    posted

    I ran across another forum that had an example.  Seems I just needed to have the page load the control before adding it to the content pane.

    Dim newTab As Tab = tabPartProducts.Tabs.Add(New Tab)
    With newTab
    .Text = productsList.Value(item.ProductId)
    Dim uc As UserControl = Page.LoadControl("~/controls/edit/MyControl.ascx")
    .ContentPane.Children.Add(uc)
    End With

    Dale

Children
No Data