views:

313

answers:

1

Hi, I am developing a slide show module for DNN, I have completed the module but I have a problem. I use modules' TabModuleID property to load the images for every instance of module, by this user can add multiple instance of modules with different pictures.Here is the problem, when I tick the show all pages checkbox in module's settings, it shows the module on every page but it does not load images because of tabModuleID, it gives different tabModuleID for every instance of module so the module cannot load the images, it needs to upload images for every module instance.Is there a way to achieve this ?(sorry for bad English)

+2  A: 

Use the ModuleId property instead of TabModuleId to store data. ModuleId is shared between the instances when you select the "Show on all pages" option (or manually add a module instance that is a reference to an existing module).

TabModuleId should be used to store information about how the data is displayed (so that you can show a module one way on your home page, and another way on an interior page), but the data itself should be stored per ModuleId.

Each new instance of the module has a new ModuleId. That is, every time you use the control panel to add a module to the page (and don't use the Add Existing Module dialog), that instance has its own ModuleId. In fact, there can only be one instance of a particular ModuleId per page. You cannot have two instances that have the same ModuleId but different TabModuleIds on the same page.

A Module ID indicates an instance of a module, while the Tab Module ID indicates that instance on a particular page. A Module Definition determines is the definition of which controls are displayed in that instance, and a Desktop Module is the package of Module Definitions for which instances are created when you add a module to a page. Desktop Modules are what you see on the Host->Module Definitions page, and in the drop down list of modules in the control panel,

bdukes
Thanks for answer but I want to user will be able to add different images for different instances of module for example user will add two instance of module to the same page and he/she will upload different images foreach of them.If I use ModuleID for retrieve data it shows same images for every instance of module but I dont want it.
e-turhan
I extended my answer above to indicate that the module ID should be different for each instance on the page.
bdukes
Thank you, I solved it by using ModuleId instead of TabModuleID
e-turhan