2009-02-16 [.NET VB] TabContainer裡的TabPanel依從資料庫存取之值決定是否呈現(ASP.NET 2.0 + AJAX) 3859 0 .Net VB 2009-04-16 摘要:[.NET VB] TabContainer裡的TabPanel依從資料庫存取之值決定是否呈現(ASP.NET 2.0 + AJAX) 以下為ascx內的code:<%@ Register Src="A.ascx" TagName="A" TagPrefix="uc1" %> <%@ Register Src="B.ascx" TagName="B" TagPrefix="uc2" %> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server"> 'HeaderText 在建立新的Tab時會出現的,在此要把他刪掉,讓HeaderText在.vb的檔案裡設定 <ajaxToolkit:TabPanel ID="TP_A" runat="server" HeaderText="AAA"> <ContentTemplate> <uc1:A ID="A1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> 'HeaderText 在建立新的Tab時會出現的,在此要把他刪掉,讓HeaderText在.vb的檔案裡設定 <ajaxToolkit:TabPanel ID="TP_B" runat="server" HeaderText="BBB"> <ContentTemplate> <uc2:B ID="B1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer>以下為.vb的檔案內容Dim dv As Data.DataView = SystemManager.LoadSystemSet Dim A_Type As Boolean = dv.Item(0).Item("A_Type") Dim B_Type As Boolean = dv.Item(0).Item("B_Type") If A_Type = True Then TP_A.HeaderText = "測試1" TP_A.Visible = True A1.Visible = True Else TP_A.Visible = False A1.Visible = False End If If B_Type = True Then TP_B.HeaderText = "測試2" TP_B.Visible = True B1.Visible = True Else TP_B.Visible = False B1.Visible = False End If ASP.NETVB 回首頁