Thank you very much, just what I needed. I made a few changes to complete my implementation.
I added one property to installedmodules.vb because I needed to have both tab and module.
Public ReadOnly Property ModuleTitle() As String
Get
Return _ModuleTitle
End Get
End Property
The Setting.ascx.vb has this in LoadSettings:
Dim objVendorModule As SoftwareController = New SoftwareController
txtVendorModule.DataSource = objVendorModule.GetInstalledModulesByName("Vendor", PortalId)
txtVendorModule.DataTextField = "TabName"
txtVendorModule.DataValueField = "TabModule"
If CType(TabModuleSettings("vendormodule"), Int32) > 0 And _
CType(TabModuleSettings("vendortab"), Int32) > 0 Then
txtVendorModule.Text = CType(TabModuleSettings("vendortab"), String) & "/" & CType(TabModuleSettings("vendormodule"), String)
End If
txtVendorModule.DataBind()
and this in SaveSettings:
Dim intTabId As Int32
Dim intModuleId As Int32
Dim strTabModule() As String
strTabModule = txtVendorModule.Text.Split("/")
intTabId = System.Convert.ToInt32(strTabModule(0))
intModuleId = System.Convert.ToInt32(strTabModule(1))
If intTabId > 0 Then
objModules.UpdateTabModuleSetting(TabModuleId, "vendortab", intTabId.ToString)
Else
objModules.DeleteModuleSetting(TabModuleId, "vendortab")
End If
If intModuleId > 0 Then
objModules.UpdateTabModuleSetting(TabModuleId, "vendormodule", intModuleId.ToString)
Else
objModules.DeleteModuleSetting(TabModuleId, "vendormodule")
End If
I added this to the itemdatabase event of the DataList :
If CType(Settings("vendormodule"), Int32) > 0 And CType(Settings("vendortab"), Int32) > 0 Then
Dim hypVendorId As HyperLink = CType(e.Item.FindControl("hypVendorId"), HyperLink)
hypVendorId.NavigateUrl = NavigateURL(CType(Settings("vendortab"), Int32), "ViewSingleVendor", _
"mid=" & CType(Settings("vendormodule"), String), _
"VendorId=" & intVendorId.ToString)
hypVendorId.Visible = True
hypVendorId.Text = strVendorId.ToString
Else
Dim lblVendorId As Label = CType(e.Item.FindControl("lblVendorId"), Label)
lblVendorId.Text = strVendorId.ToString
lblVendorId.Visible = True
End If