PDA

View Full Version : Add a tab to tabpanel from external page



marcozzz
Feb 16, 2010, 9:48 AM
Hi to allI'm a newbie VB asp.net & coolite developer (ex asp developer)


I'm trying to add a new tab to a tabpanel from a page loaded in a previous tab


in first page (default.aspx)
TabPanel2
ImageButton1 create a new tab in TabPanel2 with the page prodotti.aspx loaded inside


in second page (prodotti.aspx)
an image call the sub commandClick that add a new tab that load the page details.aspx in TabPanel2 in the first page (default.aspx)


It give me the error System.NullReferenceException when i try to add the new tab (code: TabPanel2.Tabs.Add(nuovotab))


somebody have a solution?
thanks a lot!


FIRST PAGE WITH TABPANEL2


Public Sub CreateTab(ByVal Titolo As String, ByVal Id As String, ByVal Pagina As String, ByVal tab_icon As Coolite.Ext.Web.Icon)
Dim nuovotab As Coolite.Ext.Web.Tab = New Coolite.Ext.Web.Tab
nuovotab.ID = Id
nuovotab.Title = Titolo
nuovotab.Icon = tab_icon
nuovotab.Closable = True
Dim cfg As Coolite.Ext.Web.LoadConfig = New Coolite.Ext.Web.LoadConfig(Pagina, Coolite.Ext.Web.LoadMode.IFrame)
nuovotab.LoadContent(cfg)
TabPanel2.Tabs.Add(nuovotab)
TabPanel2.SetActiveTab(nuovotab)
End Sub
Private Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ImageButton1.Click
CreateTab("Prodotti", "tab_anag_stud", "prodotti.aspx", Coolite.Ext.Web.Icon.UserRed)
End Sub




SECOND PAGE LOADED IN A TABPANEL2 TAB




Protected Sub commandClick()
Dim defpage As New _Default
defpage.CreateTab("Dettaglio", "tab_det_prod", "details.aspx", Coolite.Ext.Web.Icon.UserRed)
End Sub