First I'd like to say thank you for sharing your code, I was in the midst of implementing a IBS portal for a client and needed this functinoality but had been stuck in the design phase. I ported your code over to VB .NET Thanks again! Martin R. Bowling BEGIN CODE: In TabLayout.aspx.cs, add the following declaration: '---------------------------------------------------------------------------------------- ' Original C# Code ' protected System.Web.UI.WebControls.CheckBox showTab; ' ' VB .NET Port By Martin R. Bowling ' NexGen Solutions - Charleston, WV ' martinbowling@programmer.net ' VB .NET Code '---------------------------------------------------------------------------------------- Protected showTab As System.Web.UI.WebControls.CheckBox Then, modify SaveTabData so that UpdateTab includes showTab.Checked as a parameter: '---------------------------------------------------------------------------------------- ' Original C# Code ' private void SaveTabData() { ' ' // Construct Authorized User Roles String ' String authorizedRoles = ""; ' ' foreach(ListItem item in authRoles.Items) { ' ' if (item.Selected == true) { ' authorizedRoles = authorizedRoles + item.Text + ";"; ' } ' } ' ' // Obtain PortalSettings from Current Context ' PortalSettings portalSettings = (PortalSettings) ' Context.Items["PortalSettings"]; ' ' // update Tab info in the database ' AdminDB admin = new AdminDB(); ' admin.UpdateTab(portalSettings.PortalId, tabId, tabName.Text, ' portalSettings.ActiveTab.TabOrder, ' authorizedRoles, mobileTabName.Text, showMobile.Checked, showTab.Checked); ' } ' ' VB .NET Port By Martin R. Bowling ' NexGen Solutions - Charleston, WV ' martinbowling@programmer.net ' VB .NET Code '---------------------------------------------------------------------------------------- Private Sub SaveTabData() ' Construct Authorized User Roles String Dim authorizedRoles As String = "" Dim item As ListItem For Each item In authRoles.Items If item.Selected = True Then authorizedRoles = authorizedRoles + item.Text + ";" End If Next ' Obtain PortalSettings from Current Context Dim portalSettings As PortalSettings = CType(Context.Items("PortalSettings"), PortalSettings) ' update Tab info in the database Dim admin As AdminDB = New AdminDB() admin.UpdateTab(portalSettings.PortalId, tabId, tabName.Text, portalSettings.ActiveTab.TabOrder, authorizedRoles, mobileTabName.Text, showMobile.Checked, showTab.Checked) End Sub '---------------------------------------------------------------------------------------- ' Original C# Code ' ' public void UpdateTab (int portalId, int tabId, String tabName, int tabOrder, String authorizedRoles, ' String mobileTabName, bool showMobile, bool showTab) ' { ' ' // Create Instance of Connection and Command Object ' SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); ' SqlCommand myCommand = new SqlCommand("UpdateTab", myConnection); ' ' // Mark the Command as a SPROC ' myCommand.CommandType = CommandType.StoredProcedure; ' ' // Add Parameters to SPROC ' SqlParameter parameterPortalId = new SqlParameter("@PortalId", SqlDbType.Int, 4); ' parameterPortalId.Value = portalId; ' myCommand.Parameters.Add(parameterPortalId); ' ' SqlParameter parameterTabId = new SqlParameter("@TabId", SqlDbType.Int, 4); ' parameterTabId.Value = tabId; ' myCommand.Parameters.Add(parameterTabId); ' ' SqlParameter parameterTabName = new SqlParameter("@TabName", SqlDbType.NVarChar, 50); ' parameterTabName.Value = tabName; ' myCommand.Parameters.Add(parameterTabName); ' ' SqlParameter parameterTabOrder = new SqlParameter("@TabOrder", SqlDbType.Int, '4); ' parameterTabOrder.Value = tabOrder; ' myCommand.Parameters.Add(parameterTabOrder); ' ' SqlParameter parameterAuthRoles = new SqlParameter("@AuthorizedRoles", 'SqlDbType.NVarChar, 256); ' parameterAuthRoles.Value = authorizedRoles; ' myCommand.Parameters.Add(parameterAuthRoles); ' ' SqlParameter parameterMobileTabName = new SqlParameter("@MobileTabName", 'SqlDbType.NVarChar, 50); ' parameterMobileTabName.Value = mobileTabName; ' myCommand.Parameters.Add(parameterMobileTabName); ' ' SqlParameter parameterShowMobile = new SqlParameter("@ShowMobile", 'SqlDbType.Bit, 1); ' parameterShowMobile.Value = showMobile; ' myCommand.Parameters.Add(parameterShowMobile); ' ' SqlParameter parameterShowTab = new SqlParameter("@ShowTab", SqlDbType.Bit, 1); ' parameterShowTab.Value = showTab; ' myCommand.Parameters.Add(parameterShowTab); ' ' myConnection.Open(); ' myCommand.ExecuteNonQuery(); ' myConnection.Close(); ' } ' ' VB .NET Port By Martin R. Bowling ' NexGen Solutions - Charleston, WV ' martinbowling@programmer.net ' VB .NET Code '---------------------------------------------------------------------------------------- Public Sub UpdateTab(ByVal portalId As Integer, ByVal tabId As Integer, ByVal tabName As String, ByVal tabOrder As Integer, ByVal authorizedRoles As String, ByVal mobileTabName As String, ByVal showMobile As Boolean, ByVal showTab As Boolean) ' Create Instance of Connection and Command Object Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString")) Dim myCommand As SqlCommand = New SqlCommand("UpdateTab",myConnection) ' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure ' Add Parameters to SPROC Dim parameterPortalId As SqlParameter = New SqlParameter("@PortalId",SqlDbType.Int,4) parameterPortalId.Value = portalId myCommand.Parameters.Add(parameterPortalId) Dim parameterTabId As SqlParameter = New SqlParameter("@TabId",SqlDbType.Int,4) parameterTabId.Value = tabId myCommand.Parameters.Add(parameterTabId) Dim parameterTabName As SqlParameter = New SqlParameter("@TabName",SqlDbType.NVarChar,50) parameterTabName.Value = tabName myCommand.Parameters.Add(parameterTabName) Dim parameterTabOrder As SqlParameter = New SqlParameter("@TabOrder",SqlDbType.Int,4) parameterTabOrder.Value = tabOrder myCommand.Parameters.Add(parameterTabOrder) Dim parameterAuthRoles As SqlParameter = New SqlParameter("@AuthorizedRoles",SqlDbType.NVarChar,256) parameterAuthRoles.Value = authorizedRoles myCommand.Parameters.Add(parameterAuthRoles) Dim parameterMobileTabName As SqlParameter = New SqlParameter("@MobileTabName",SqlDbType.NVarChar,50) parameterMobileTabName.Value = mobileTabName myCommand.Parameters.Add(parameterMobileTabName) Dim parameterShowMobile As SqlParameter = New SqlParameter("@ShowMobile",SqlDbType.Bit,1) parameterShowMobile.Value = showMobile myCommand.Parameters.Add(parameterShowMobile) Dim parameterShowTab As SqlParameter = New SqlParameter("@ShowTab",SqlDbType.Bit,1) parameterShowTab.Value = showTab myCommand.Parameters.Add(parameterShowTab) myConnection.Open() myCommand.ExecuteNonQuery() myConnection.Close() End Sub '---------------------------------------------------------------------------------------- ' Original C# Code ' 'using System; 'using System.Configuration; 'using System.Web; 'using System.Data; 'using System.Data.SqlClient; 'using System.Collections; ' 'namespace ASPNetPortal { ' ' //********************************************************************* ' // ' // TabStripDetails Class ' // ' // Class that encapsulates the just the tabstrip details -- TabName, TabId and TabOrder ' // -- for a specific Tab in the Portal ' // ' //********************************************************************* ' ' public class TabStripDetails { ' ' public int TabId; ' public String TabName; ' public int TabOrder; ' public String AuthorizedRoles; ' } ' ' //********************************************************************* ' // ' // TabSettings Class ' // ' // Class that encapsulates the detailed settings for a specific Tab ' // in the Portal ' // ' //********************************************************************* ' ' public class TabSettings { ' ' public int TabIndex; ' public int TabId; ' public String TabName; ' public int TabOrder; ' public String MobileTabName; ' public String AuthorizedRoles; ' public bool ShowMobile; ' public bool ShowTab; ' public ArrayList Modules = new ArrayList(); ' } ' ' //********************************************************************* ' // ' // ModuleSettings Class ' // ' // Class that encapsulates the detailed settings for a specific Tab ' // in the Portal ' // ' //********************************************************************* ' ' public class ModuleSettings { ' ' public int ModuleId; ' public int ModuleDefId; ' public int TabId; ' public int CacheTime; ' public int ModuleOrder; ' public String PaneName; ' public String ModuleTitle; ' public String AuthorizedEditRoles; ' public bool ShowMobile; ' public String DesktopSrc; ' public String MobileSrc; ' } ' ' //********************************************************************* ' // ' // PortalSettings Class ' // ' // This class encapsulates all of the settings for the Portal, as well ' // as the configuration settings required to execute the current tab ' // view within the portal. ' // ' //********************************************************************* ' ' public class PortalSettings { ' ' public int PortalId; ' public String PortalName; ' public bool AlwaysShowEditButton; ' public ArrayList DesktopTabs = new ArrayList(); ' public ArrayList MobileTabs = new ArrayList(); ' public TabSettings ActiveTab = new TabSettings(); ' ' //********************************************************************* ' // ' // PortalSettings Constructor ' // ' // The PortalSettings Constructor encapsulates all of the logic ' // necessary to obtain configuration settings necessary to render ' // a Portal Tab view for a given request. ' // ' // These Portal Settings are stored within a SQL database, and are ' // fetched below by calling the "GetPortalSettings" stored procedure. ' // This stored procedure returns values as SPROC output parameters, ' // and using three result sets. ' // ' //********************************************************************* ' ' public PortalSettings(int tabIndex, int tabId) { ' ' // Create Instance of Connection and Command Object ' SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); ' SqlCommand myCommand = new SqlCommand("GetPortalSettings", myConnection); ' ' // Mark the Command as a SPROC ' myCommand.CommandType = CommandType.StoredProcedure; ' ' // Add Parameters to SPROC ' SqlParameter parameterPortalAlias = new SqlParameter("@PortalAlias", SqlDbType.NVarChar, 50); ' parameterPortalAlias.Value = "p_default"; ' myCommand.Parameters.Add(parameterPortalAlias); ' ' SqlParameter parameterTabId = new SqlParameter("@TabId", SqlDbType.Int, 4); ' parameterTabId.Value = tabId; ' myCommand.Parameters.Add(parameterTabId); ' ' // Add out parameters to Sproc ' SqlParameter parameterPortalID = new SqlParameter("@PortalID", SqlDbType.Int, 4); ' parameterPortalID.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterPortalID); ' ' SqlParameter parameterPortalName = new SqlParameter("@PortalName", SqlDbType.NVarChar, 128); ' parameterPortalName.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterPortalName); ' ' SqlParameter parameterEditButton = new SqlParameter("@AlwaysShowEditButton", SqlDbType.Bit, 1); ' parameterEditButton.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterEditButton); ' ' SqlParameter parameterTabName = new SqlParameter("@TabName", SqlDbType.NVarChar, 50); ' parameterTabName.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterTabName); ' ' SqlParameter parameterTabOrder = new SqlParameter("@TabOrder", SqlDbType.Int, 4); ' parameterTabOrder.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterTabOrder); ' ' SqlParameter parameterMobileTabName = new SqlParameter("@MobileTabName", SqlDbType.NVarChar, 50); ' parameterMobileTabName.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterMobileTabName); ' ' SqlParameter parameterAuthRoles = new SqlParameter("@AuthRoles", SqlDbType.NVarChar, 256); ' parameterAuthRoles.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterAuthRoles); ' ' SqlParameter parameterShowMobile = new SqlParameter("@ShowMobile", SqlDbType.Bit, 1); ' parameterShowMobile.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterShowMobile); ' ' SqlParameter parameterShowTab = new SqlParameter("@ShowTab", SqlDbType.Bit, 1); ' parameterShowTab.Direction = ParameterDirection.Output; ' myCommand.Parameters.Add(parameterShowTab); ' ' // Open the database connection and execute the command ' myConnection.Open(); ' SqlDataReader result = myCommand.ExecuteReader(); ' ' // Read the first resultset -- Desktop Tab Information ' while(result.Read()) { ' ' TabStripDetails tabDetails = new TabStripDetails(); ' tabDetails.TabId = (int) result["TabId"]; ' tabDetails.TabName = (String) result["TabName"]; ' tabDetails.TabOrder = (int) result["TabOrder"]; ' tabDetails.AuthorizedRoles = (String) result["AuthorizedRoles"]; ' ' this.DesktopTabs.Add(tabDetails); ' } ' ' if (this.ActiveTab.TabId == 0) { ' this.ActiveTab.TabId = ((TabStripDetails) this.DesktopTabs[0]).TabId; ' } ' ' // Read the second result -- Mobile Tab Information ' result.NextResult(); ' ' while(result.Read()) { ' ' TabStripDetails tabDetails = new TabStripDetails(); ' tabDetails.TabId = (int) result["TabId"]; ' tabDetails.TabName = (String) result["MobileTabName"]; ' tabDetails.AuthorizedRoles = (String) result["AuthorizedRoles"]; ' ' this.MobileTabs.Add(tabDetails); ' } ' ' // Read the third result -- Module Tab Information ' result.NextResult(); ' ' while(result.Read()) { ' ' ModuleSettings m = new ModuleSettings(); ' m.ModuleId = (int) result["ModuleID"]; ' m.ModuleDefId = (int) result["ModuleDefID"]; ' m.TabId = (int) result["TabID"]; ' m.PaneName = (String) result["PaneName"]; ' m.ModuleTitle = (String) result["ModuleTitle"]; ' m.AuthorizedEditRoles = (String) result["AuthorizedEditRoles"]; ' m.CacheTime = (int) result["CacheTime"]; ' m.ModuleOrder = (int) result["ModuleOrder"]; ' m.ShowMobile = (bool) result["ShowMobile"]; ' m.DesktopSrc = (String) result["DesktopSrc"]; ' m.MobileSrc = (String) result["MobileSrc"]; ' ' this.ActiveTab.Modules.Add(m); ' } ' ' // Now read Portal out params ' result.NextResult(); ' ' this.PortalId = (int) parameterPortalID.Value; ' this.PortalName = (String) parameterPortalName.Value; ' this.AlwaysShowEditButton = (bool) parameterEditButton.Value; ' this.ActiveTab.TabIndex = tabIndex; ' this.ActiveTab.TabId = tabId; ' this.ActiveTab.TabOrder = (int) parameterTabOrder.Value; ' this.ActiveTab.MobileTabName = (String) parameterMobileTabName.Value; ' this.ActiveTab.AuthorizedRoles = (String) parameterAuthRoles.Value; ' this.ActiveTab.TabName = (String) parameterTabName.Value; ' this.ActiveTab.ShowMobile = (bool) parameterShowMobile.Value; ' this.ActiveTab.ShowTab = (bool) parameterShowTab.Value; ' ' myConnection.Close(); ' } ' ' ' //********************************************************************* ' // ' // GetModuleSettings Static Method ' // ' // The PortalSettings.GetModuleSettings Method returns a hashtable of ' // custom module specific settings from the database. This method is ' // used by some user control modules (Xml, Image, etc) to access misc ' // settings. ' // ' //********************************************************************* ' ' public static Hashtable GetModuleSettings(int moduleId) { ' ' // Get Settings for this module from the database ' Hashtable _settings = new Hashtable(); ' ' // Create Instance of Connection and Command Object ' SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); ' SqlCommand myCommand = new SqlCommand("GetModuleSettings", myConnection); ' ' // Mark the Command as a SPROC ' myCommand.CommandType = CommandType.StoredProcedure; ' ' // Add Parameters to SPROC ' SqlParameter parameterModuleId = new SqlParameter("@ModuleID", SqlDbType.Int, 4); ' parameterModuleId.Value = moduleId; ' myCommand.Parameters.Add(parameterModuleId); ' ' // Execute the command ' myConnection.Open(); ' SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection); ' ' while (dr.Read()) { ' ' _settings[dr.GetString(0)] = dr.GetString(1); ' } ' ' dr.Close(); ' ' return _settings; ' } ' ' /// ' /// GetTabs Method ' /// ' /// The GetTabs method returns a SqlDataReader containing all of the ' /// Tabs database. ' /// ' /// SqlDataReader containing all tabs ' public SqlDataReader GetTabs() ' { ' ' // Create Instance of Connection and Command Object ' SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); ' SqlCommand myCommand = new SqlCommand("GetTabs", myConnection); ' ' // Mark the Command as a SPROC ' myCommand.CommandType = CommandType.StoredProcedure; ' ' // Add Parameters to SPROC ' SqlParameter parameterPortalID = new SqlParameter("@PortalID", SqlDbType.Int, 4); ' parameterPortalID.Value = PortalId; ' myCommand.Parameters.Add(parameterPortalID); ' ' // Execute the command ' myConnection.Open(); ' SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection); ' ' // Return the datareader ' return result; ' } ' ' /// ' /// gets the id of a named tab ' /// ' /// name of the tab ' /// TabID (in database) ' public int GetTabId(string tabName) ' { ' foreach(TabStripDetails tabStripDetails in this.DesktopTabs) ' { ' if(tabStripDetails.TabName == tabName) ' return tabStripDetails.TabId; ' } ' throw new ArgumentOutOfRangeException("Tab name does not exist"); ' } ' ' } '} ' ' VB .NET Port By Martin R. Bowling ' NexGen Solutions - Charleston, WV ' martinbowling@programmer.net ' VB .NET Code '---------------------------------------------------------------------------------------- Imports System Imports System.Configuration Imports System.Web Imports System.Data Imports System.Data.SqlClient Imports System.Collections Namespace ASPNetPortal '********************************************************************* ' ' TabStripDetails Class ' ' Class that encapsulates the just the tabstrip details -- TabName, TabId and TabOrder ' -- for a specific Tab in the Portal ' '********************************************************************* Public Class TabStripDetails Public TabId As Integer Public TabName As String Public TabOrder As Integer Public AuthorizedRoles As String End Class '********************************************************************* ' ' TabSettings Class ' ' Class that encapsulates the detailed settings for a specific Tab ' in the Portal ' '********************************************************************* Public Class TabSettings Public TabIndex As Integer Public TabId As Integer Public TabName As String Public TabOrder As Integer Public MobileTabName As String Public AuthorizedRoles As String Public ShowMobile As Boolean Public ShowTab As Boolean Public Modules As ArrayList = New ArrayList() End Class '********************************************************************* ' ' ModuleSettings Class ' ' Class that encapsulates the detailed settings for a specific Tab ' in the Portal ' '********************************************************************* Public Class ModuleSettings Public ModuleId As Integer Public ModuleDefId As Integer Public TabId As Integer Public CacheTime As Integer Public ModuleOrder As Integer Public PaneName As String Public ModuleTitle As String Public AuthorizedEditRoles As String Public ShowMobile As Boolean Public DesktopSrc As String Public MobileSrc As String End Class '********************************************************************* ' ' PortalSettings Class ' ' This class encapsulates all of the settings for the Portal, as well ' as the configuration settings required to execute the current tab ' view within the portal. ' '********************************************************************* Public Class PortalSettings Public PortalId As Integer Public PortalName As String Public AlwaysShowEditButton As Boolean Public DesktopTabs As ArrayList = New ArrayList() Public MobileTabs As ArrayList = New ArrayList() Public ActiveTab As TabSettings = New TabSettings() '********************************************************************* ' ' PortalSettings Constructor ' ' The PortalSettings Constructor encapsulates all of the logic ' necessary to obtain configuration settings necessary to render ' a Portal Tab view for a given request. ' ' These Portal Settings are stored within a SQL database, and are ' fetched below by calling the "GetPortalSettings" stored procedure. ' This stored procedure returns values as SPROC output parameters, ' and using three result sets. ' '********************************************************************* Public Sub New(ByVal tabIndex As Integer, ByVal tabId As Integer) ' Create Instance of Connection and Command Object Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString")) Dim myCommand As SqlCommand = New SqlCommand("GetPortalSettings",myConnection) ' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure ' Add Parameters to SPROC Dim parameterPortalAlias As SqlParameter = New SqlParameter("@PortalAlias",SqlDbType.NVarChar,50) parameterPortalAlias.Value = "p_default" myCommand.Parameters.Add(parameterPortalAlias) Dim parameterTabId As SqlParameter = New SqlParameter("@TabId",SqlDbType.Int,4) parameterTabId.Value = tabId myCommand.Parameters.Add(parameterTabId) ' Add out parameters to Sproc Dim parameterPortalID As SqlParameter = New SqlParameter("@PortalID",SqlDbType.Int,4) parameterPortalID.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterPortalID) Dim parameterPortalName As SqlParameter = New SqlParameter("@PortalName",SqlDbType.NVarChar,128) parameterPortalName.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterPortalName) Dim parameterEditButton As SqlParameter = New SqlParameter("@AlwaysShowEditButton",SqlDbType.Bit,1) parameterEditButton.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterEditButton) Dim parameterTabName As SqlParameter = New SqlParameter("@TabName",SqlDbType.NVarChar,50) parameterTabName.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterTabName) Dim parameterTabOrder As SqlParameter = New SqlParameter("@TabOrder",SqlDbType.Int,4) parameterTabOrder.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterTabOrder) Dim parameterMobileTabName As SqlParameter = New SqlParameter("@MobileTabName",SqlDbType.NVarChar,50) parameterMobileTabName.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterMobileTabName) Dim parameterAuthRoles As SqlParameter = New SqlParameter("@AuthRoles",SqlDbType.NVarChar,256) parameterAuthRoles.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterAuthRoles) Dim parameterShowMobile As SqlParameter = New SqlParameter("@ShowMobile",SqlDbType.Bit,1) parameterShowMobile.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterShowMobile) Dim parameterShowTab As SqlParameter = New SqlParameter("@ShowTab",SqlDbType.Bit,1) parameterShowTab.Direction = ParameterDirection.Output myCommand.Parameters.Add(parameterShowTab) ' Open the database connection and execute the command myConnection.Open() Dim result As SqlDataReader = myCommand.ExecuteReader() ' Read the first resultset -- Desktop Tab Information While result.Read() Dim tabDetails As TabStripDetails = New TabStripDetails() tabDetails.TabId = CType(result("TabId"), Integer) tabDetails.TabName = CType(result("TabName"), String) tabDetails.TabOrder = CType(result("TabOrder"), Integer) tabDetails.AuthorizedRoles = CType(result("AuthorizedRoles"), String) Me.DesktopTabs.Add(tabDetails) End While If Me.ActiveTab.TabId = 0 Then Me.ActiveTab.TabId = (CType(Me.DesktopTabs(0), TabStripDetails)).TabId End If ' Read the second result -- Mobile Tab Information result.NextResult() While result.Read() Dim tabDetails As TabStripDetails = New TabStripDetails() tabDetails.TabId = CType(result("TabId"), Integer) tabDetails.TabName = CType(result("MobileTabName"), String) tabDetails.AuthorizedRoles = CType(result("AuthorizedRoles"), String) Me.MobileTabs.Add(tabDetails) End While ' Read the third result -- Module Tab Information result.NextResult() While result.Read() Dim m As ModuleSettings = New ModuleSettings() m.ModuleId = CType(result("ModuleID"), Integer) m.ModuleDefId = CType(result("ModuleDefID"), Integer) m.TabId = CType(result("TabID"), Integer) m.PaneName = CType(result("PaneName"), String) m.ModuleTitle = CType(result("ModuleTitle"), String) m.AuthorizedEditRoles = CType(result("AuthorizedEditRoles"), String) m.CacheTime = CType(result("CacheTime"), Integer) m.ModuleOrder = CType(result("ModuleOrder"), Integer) m.ShowMobile = CType(result("ShowMobile"), Boolean) m.DesktopSrc = CType(result("DesktopSrc"), String) m.MobileSrc = CType(result("MobileSrc"), String) Me.ActiveTab.Modules.Add(m) End While ' Now read Portal out params result.NextResult() Me.PortalId = CType(parameterPortalID.Value, Integer) Me.PortalName = CType(parameterPortalName.Value, String) Me.AlwaysShowEditButton = CType(parameterEditButton.Value, Boolean) Me.ActiveTab.TabIndex = tabIndex Me.ActiveTab.TabId = tabId Me.ActiveTab.TabOrder = CType(parameterTabOrder.Value, Integer) Me.ActiveTab.MobileTabName = CType(parameterMobileTabName.Value, String) Me.ActiveTab.AuthorizedRoles = CType(parameterAuthRoles.Value, String) Me.ActiveTab.TabName = CType(parameterTabName.Value, String) Me.ActiveTab.ShowMobile = CType(parameterShowMobile.Value, Boolean) Me.ActiveTab.ShowTab = CType(parameterShowTab.Value, Boolean) myConnection.Close() End Sub '********************************************************************* ' ' GetModuleSettings Static Method ' ' The PortalSettings.GetModuleSettings Method returns a hashtable of ' custom module specific settings from the database. This method is ' used by some user control modules (Xml, Image, etc) to access misc ' settings. ' '********************************************************************* Public Shared Function GetModuleSettings(ByVal moduleId As Integer) As Hashtable ' Get Settings for this module from the database Dim _settings As Hashtable = New Hashtable() ' Create Instance of Connection and Command Object Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString")) Dim myCommand As SqlCommand = New SqlCommand("GetModuleSettings",myConnection) ' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure ' Add Parameters to SPROC Dim parameterModuleId As SqlParameter = New SqlParameter("@ModuleID",SqlDbType.Int,4) parameterModuleId.Value = moduleId myCommand.Parameters.Add(parameterModuleId) ' Execute the command myConnection.Open() Dim dr As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection) While dr.Read() _settings(dr.GetString(0)) = dr.GetString(1) End While dr.Close() Return _settings End Function '/ '/ GetTabs Method '/ '/ The GetTabs method returns a SqlDataReader containing all of the '/ Tabs database. '/ '/ SqlDataReader containing all tabs Public Function GetTabs() As SqlDataReader ' Create Instance of Connection and Command Object Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("connectionString")) Dim myCommand As SqlCommand = New SqlCommand("GetTabs",myConnection) ' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure ' Add Parameters to SPROC Dim parameterPortalID As SqlParameter = New SqlParameter("@PortalID",SqlDbType.Int,4) parameterPortalID.Value = PortalId myCommand.Parameters.Add(parameterPortalID) ' Execute the command myConnection.Open() Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection) ' Return the datareader Return result End Function '/ '/ gets the id of a named tab '/ '/ name of the tab '/ TabID (in database) Public Function GetTabId(ByVal tabName As String) As Integer Dim tabStripDetails As TabStripDetails For Each tabStripDetails In Me.DesktopTabs If tabStripDetails.TabName = tabName Then Return tabStripDetails.TabId End If Next Throw New ArgumentOutOfRangeException("Tab name does not exist") End Function End Class End Namespace :END CODE --