Bill, thanks very much for dedicating that time to my issue. Yes, you're right about the code not being exactly the same between the settings and main module. The settings are saved in the TabModuleSettings table. Here is the requested code:
SETTINGS.ASCX.VB (LOADSETTINGS)
Public Overrides Sub LoadSettings()
Try
If Not Page.IsPostBack Then
If Not IsNothing(TabModuleSettings("page_info")) Then '*this works in Settings
UnitInfoTemplate.Text = CType(TabModuleSettings("page_info"), String)
Else
UnitInfoTemplate.Text = ""
End If
If Not IsDBNull(TabModuleSettings("NDD_PushLine")) Then
txtPushLine.Text = CType(TabModuleSettings("NDD_PushLine"), String)
Else
txtPushLine.Text = ""
End If
End If
Catch exc As Exception
ProcessModuleLoadException(Me, exc)
End Try
End Sub
SETTINGS.ASCX.VB (UPDATESETTINGS)
Public Overrides Sub UpdateSettings()
Try
Dim objModules As New Entities.Modules.ModuleController
objModules.UpdateTabModuleSetting(TabModuleId, "page_info", UnitInfoTemplate.Text.Trim) 'works fine
objModules.UpdateTabModuleSetting(TabModuleId, "NDD_PushLine", txtPushLine.Text.Trim) 'works fine
' Redirect back to the portal home page
Response.Redirect(NavigateURL(), True)
Catch exc As Exception
ProcessModuleLoadException(Me, exc)
End Try
End Sub
VIEWMODULE.ASCX.VB (PAGE LOAD)
If Not Page.IsPostBack Then
'Dim settings As Hashtable = New DotNetNuke.Entities.Modules.ModuleController().GetTabModuleSettings(TabModuleId) 'commented out or not doesn't work
If CType(settings("page_info"), String) <> "" Then
lblUnitInfo.Text = CType(settings("page_info"), String) 'debugger skips this line cuz it thinks page_info=""
End If
'lblUnitInfo.Text = CType(Settings("NDD_PushLine"), String) 'if uncommented this correctly pulls the value
ShowUnitInfo(UnitID)
End If
Here is what my TabModuleSettings Table shows
100 |
NDD_Hours |
12 |
100 |
NDD_PushLine |
got a new bullet yo |
100 |
page_info |
<p>Now we're using the Page_Info name to see if we can get info for [UNIT] which has an ID of [UNITID]</p> |
100 |
TPP_Board |
200 |
100 |
TPP_General |
500 |
100 |
unitinfotemplate |
<p>This is my wonderful template text for [UNIT] with an ID of [UNITID]</p> |