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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...module level variablesmodule level variables
Previous
 
Next
New Post
4/3/2013 5:16 AM
 

Hi All,

I am setting some values in module level variables in my edit page.
Can i access those values in a simple class file inside my module...?
Need your suggestions ASAP.

Thanks 


Cheers..!!!

Amit Mohanty
Mindfire Solutions
 
New Post
4/3/2013 6:14 AM
 
Amit, Yes you can.
Declare your variable in ascx.cs page as public property.
Access it in your simple.cs file with full namespace.

Thanks,
Sunil Kumar [ DNN Developer, Mindfire Solutions,India ]
 
New Post
4/3/2013 6:23 AM
 

What do you mean by simple class file - do you mean can you persist or store module data.

If so yes you can store data to either your own database or to the built in dotnetnuke module settings table.

To store a module value to the core module settings table you would do something like:

String settingValue = "somevalue";
var objModules = new ModuleController();
objModules.UpdateModuleSetting(ModuleId, "settingName", settingValue);

And to retrieve that setting you would do something like

ModuleController objModules = new ModuleController();
Hashtable mySettings = objModules.GetModuleSettings(ModuleId);
settingValue = mySettings["settingName"].ToString();

Westa

 

 
New Post
4/3/2013 6:26 AM
 
Sunil, i can't do that.
Let me explain my exact situation.

I have a class file which will be hit by a scheduler every minute.
In that class file i need the token values which is set in the edit page as module level variables.

Anyway i am taking the easy way out, i am writing a stored procedure to directly fetch the token from ModuleSettings table.

Still waiting for a more effective solution.

Cheers..!!!

Amit Mohanty
Mindfire Solutions
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...module level variablesmodule level variables


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