I have a project which allows a user to dynamicly create a tabbed menu, which then navigates a multiview control, and attempts to load user controls into the views of the multiview?
with me? ok..
the problrm is that the views do not seem to contain the loaded user control (which is just a label).
this is how i create the tabbed menu and load the views / controls into the multiview.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Declare variables / objects
Dim MItem As New MenuItem
Dim strText As String
Dim ctrl As Control = Nothing
Dim view As New View
'assign textbox entry to name of tab
strText = txtTab.Text
MItem.Text = strText
'assign textbox value to value of tab
MItem.Value = txtTabNo.Text
'load user web control into empty control object
ctrl = LoadControl("BuildForm.ascx")
'add web user control object to view object
'add view object to multiview object
Session("MultiView1") = MultiView1
and this is how i navigate the tabbed menu:
Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick
Dim i As Integer
i = Menu1.SelectedValue - 1
MultiView1.ActiveViewIndex = i
the menu seems to navigate and change views, yet the dynamicly loaded usercontrol is not in the views.
many thanks for suggestions