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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesSettings not savingSettings not saving
Previous
 
Next
New Post
4/7/2013 7:39 PM
 

Hi All,

I'm attempting to develop my first module and am having trouble getting the module settings to save.
In my ModuleSettingsBase I defined a bunch of properties like this:
public string Setting1
{
get{
     if (Settings.Contains("Setting1")) return Settings["Setting1"].ToString();
     return string.Empty;
}
set{
     var mc = new ModuleController();
     mc.UpdateModuleSetting(ModuleId, "Setting1", value.ToString());
}
}

And in my Settings.ascx I just assign a value from the appropriate text field (in UpdateSettings() method):
Setting1 = textField.Text

I read through a bunch of articles. They all seem to do it in a similar way. Can't figure out what's missing ....
Thx in advance for help and/or pointers!
Rgds - M.

 
New Post
4/9/2013 6:01 PM
 
Answer: bug in the VS2012 template
Code wasn't updating on build.
 
New Post
4/17/2013 6:22 AM
 
Hi Marcus

In the get part, first you are returning "return Settings["Setting1"].ToString()" and again immediately your are returning "return string.Empty;", so the final value returning is null.
So, try by removing "return string.Empty".
Hopefully, it may do the trick.

Thanks,
Avinash Kumar [ DNN Developer, Mindfire Solutions,India ]
 
New Post
4/17/2013 6:35 AM
 
@Avinash

Err no. That cannot be true.
- string.Empty is NOT the same as null
- if the first return is executed the second CANNOT be executed.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
4/17/2013 10:20 AM
 
Marcus Bauer wrote:
Answer: bug in the VS2012 template
Code wasn't updating on build.

 

This was likely a bug that was fixed in the most recent release of the templates 


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesSettings not savingSettings not saving


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.

Content Layout

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out