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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Setting container at runtimeSetting container at runtime
Previous
 
Next
New Post
4/3/2009 11:45 AM
 

Hi,

I am trying to dynamically set the container at runtime for a custom module I have written.

I have created a pageInit routine and added the following code into the view.ascx file.

ModuleConfiguration.ModuleTitle =

"";
ModuleConfiguration.ContainerPath =
"Portals/_default/Containers/BlogTopFiveContainer/";
ModuleConfiguration.ContainerSrc =
"BlogTopFiveContainer.ascx";

The title is being set to an empty string as intended but the module container is still defaulting to something other than that set in the container path and src.

Please could someone point me in the correct direction and let me know what I am doing wrong?

Thanks in advance.

 
New Post
4/4/2009 10:43 AM
 

Update:

I am unable to debug at module level but with response.write I have ascertained that the default containersrc value is being set AFTER I am setting it at the module level.

I thought module level would take precedence - some help please!!

Cheers

 
New Post
4/4/2009 11:35 PM
 

A brief look at the InjectModule method found in the framework source code Skin.vb file and knowledge of the ASP.Net page-life cycle leads me to believe that it is not possible to change the container control of a module from within the module itself. By the time that the Page_Init event of the module control fires, the container (user control) has already been created and added to it's parent's control collection.

You might, however, try using an instance of the ModuleController business class to 1) Get the module's ModuleInfo object, 2) alter it's ContainerSrc property, 3) Update the ModuleInfo back to the database which I think will clear the Module Cache-if not have to do separately, then 4) Redirect back to the original URL to refresh the page - hopefully with the module now displayed in your choice of container. I have not tried the above so make no guarantee that it will work or that these steps will not require some modification.


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
4/6/2009 5:47 AM
 

I had a go at your suggestion William.

Not 100% sure whether or not I was doing it correctly or not though as nothing seemed to change.

For the time being I have skinned at the pane level (all of my custom controls in said pane use the same skin)

I would really appreciate any further assistence on this from anyone though as I'm sure it should not be such a chore to preset a skin for a custom moule!!!

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Setting container at runtimeSetting container at runtime


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