Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module Settings not retrievedModule Settings not retrieved
Previous
 
Next
New Post
6/23/2008 12:51 AM
 

Sounds like something else went wrong on one of those lines then ... maybe the ctype(..., integer) is failing because it is not an integer value?  You should try breaking the line into smaller tasks - get the string, then convert it .. might help debug the problem.

Edit: sorry I misread - it is the integer you can get and not the string.  This is what I do in my modules:

Dim settings As Hashtable = New ModuleController().GetTabModuleSettings(TabModuleId)
If CType(settings("blah"), String) <> "" Then
    s = CType(settings("blah"), String)
End If

JK.


You know your website is cool, so why not let your users help you by spreading the word on social networking sites - get the DotNetNuke Social Bookmarks Module with 57 different ways to add social bookmarks to your site ... or download the FREE demo right now
 
New Post
6/23/2008 11:05 AM
 

Thanks JK.  I tried it and it's the exact same.

If I put in "one_setting" it sees that "one_setting" as blank even though it's not because I'm looking in the database.  If, however, I put in "another_setting" it succesfully pulls that from the hashtable.  I see both "one_setting" and "another_setting" are in the hashtable, not duplicated, with the same moduleid...


I'm too poor for anything other than the community version
 
New Post
6/23/2008 7:30 PM
 

I changed the setting name to "page_info" to see if that wold help.  It doesn't.

In my module settings.ascx.vb code below...it succesfully retrieves the "page_info" value........but the very same code in my view.ascx.vb does not (always shows the value as being "").  I would think there must be something in my settings.ascx.vb that makes this code work except that in the view.ascx.vb this code will work for other settings other than "page_info"?????

If Not IsNothing(TabModuleSettings("page_info")) Then
' Make sure to use NOT ISNOTHING instead of NOT ISDBNULL!
    UnitInfoTemplate.Text = CType(TabModuleSettings("page_info"), String)
Else
    UnitInfoTemplate.Text = ""
End If


I'm too poor for anything other than the community version
 
New Post
6/23/2008 9:03 PM
 

Ryno,

We're all missing something simple here, perhaps if you post the following three segments of code (all for the same setting key) we'll spot the error:

1. Code segment from SaveSettings method of your settings.ascx.vb where the value is saved to TabModuleSettings. Are you saving this value to the TabModuleSettings table (using the method UpdateTabModuleSetting which takes as its first parameter the TabModuleID) or to the ModuleSettings table (using the method UpdateModuleSetting which takes as its first parameter the ModuleID? When you indicated that you verified that the value is getting saved to the TabModuleSettings table with the correct ModuleID, I am wondering if you are mixing up the use of TabModuleID (for TabModuleSettings) and ModuleID (for ModuleSettings).

2. Code segment from LoadSettings method of your settings.ascx.vb where the value is retreived from TabModuleSettings. Yes, I know you posted that above, but want to see all three segments of code in one post.

3. Code segment from your view.ascx.vb where you are attempting to retrieve the value but it is always returning an empty string. In your above post, you say that this is the exact same code as in settings.ascx.vb. This cannot be the case as PortalModuleBase from which your view control should inherit does not expose a TabModuleSettings hashtable as a property - only the Settings hashtable which is a merge of ModuleSettings and TabModuleSettings is provided.

A final though - .Net Hashtable keys are (when using the default constructor, at least) case-sensitive. Check that the case of the setting key used in the view control is the same as that used in the setting control.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
6/24/2008 7:15 PM
 

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 &lt;p&gt;Now we're using the Page_Info name to see if we can get info for [UNIT] which has an ID of [UNITID]&lt;/p&gt;
100 TPP_Board 200
100 TPP_General 500
100 unitinfotemplate &lt;p&gt;This is my wonderful template text for [UNIT] with an ID of [UNITID]&lt;/p&gt;


I'm too poor for anything other than the community version
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module Settings not retrievedModule Settings not retrieved


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out