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.0Problem retrieving module settingsProblem retrieving module settings
Previous
 
Next
New Post
3/9/2008 4:18 PM
 

Greetings,

For some reason when I try to retrieve custom Module settings, the retrieval succeeds (no error is generated by the code), but no information is returned.

I've setup two Settings, "Realm" and "Guild" and the module is able to let me save those values and retrieves them appropriately for future editing of the module settings, but when I try to use those settings in the module by using something like "Ctype(Settings("Guild"), String)" I get an empty string back.

Any help for the lost? I'm about at my wits end. I'll post whatever code is needed.

Thanks

 
New Post
3/9/2008 5:30 PM
 

Please show the code you are using for saving the custom module settings. It should be similar to:

Dim mc As New DotNetNuke.Entities.Modules.ModuleController
mc.UpdateModuleSetting(ModuleId, "Realm", _realmValue)
mc.UpdateModuleSetting(ModuleId, "Guild", _guildValue)

If you are simply doing:

Settings("Realm") = _realmValue

you will be only updating the value in the in-memory hashtable which will not persist accross postbacks, etc.


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
3/9/2008 11:15 PM
 

This would be the code that's typically of what you would find in the Settings codebehind, and that is what I have.

As far as the behavior of the module in regards to setting the values, everything is fine.

The problem is that I can't seem to pull the values back out when I try to use them in the module when outside of the Settings area.

 
New Post
3/10/2008 8:18 AM
 

What happens when you add the following line after updating your settings:

DotNetNuke.Entities.Modules.ModuleController.SynchronizeModule(ModuleId)


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
3/10/2008 2:54 PM
 

There is no difference.

Here's the code. I have trimmed away some of it, but have left the overall structure.

In the Settings file:

 

 

 

 

Imports System
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.Services.Exceptions.Exceptions

Namespace DotNetNuke.Modules.tss_DKP

    Partial Public Class Settings

        Inherits ModuleSettingsBase

#Region "Public Methods"

        Public Overrides Sub LoadSettings()

            Try

                If Not Null.IsNull(Settings("Realm")) Then
                    txtRealm.Text = Convert.ToString(Settings("Realm"))
                Else
                    txtRealm.Text = ""
                End If

                If Not Null.IsNull(Settings("Guild")) Then
                    txtGuild.Text = Convert.ToString(Settings("Guild"))
                Else
                    txtGuild.Text = ""
                End If

            Catch exc As Exception 'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try

        End Sub

        Public Overrides Sub UpdateSettings()

            Try

                Dim modController As New DotNetNuke.Entities.Modules.ModuleController
                modController.UpdateModuleSetting(ModuleId, "Realm", txtRealm.Text.Trim)
                modController.UpdateModuleSetting(ModuleId, "Guild", txtGuild.Text.Trim)
                ModuleController.SynchronizeModule(ModuleId)

            Catch exc As Exception 'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try

        End Sub

#End Region

    End Class

End Namespace

The code that is used in the module:;

Imports System.IO
Imports System.Net
Imports System.Xml
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Security.PortalSecurity

Imports DotNetNuke.UI.Utilities
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.Services.Exceptions.Exceptions


Namespace DotNetNuke.Modules.tss_DKP

    Partial Public Class tss_ucPlayers
        Inherits PortalModuleBase

        Protected Sub CommandMenu_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lnkAddPlayer.Click, lnkUpdatePlayer.Click, lnkDeletePlayer.Click, lnkSyncPlayer.Click

            Dim txtRealm As String = CType(Settings("Realm"), String)
            Dim txtGuild As String = CType(Settings("Guild"), String)

        End Sub

    End Class

End Namespace

A large part of that file I've chopped out for clarity here.

Thanks again for the help!

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem retrieving module settingsProblem retrieving module settings


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