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

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedError when trying to load the edit.ascx controlError when trying to load the edit.ascx control
Previous
 
Next
New Post
10/31/2013 5:25 AM
 
Hi Wes,

Thanks for answering.

So there is no way of knowing whether the page you are going to load supports popups i.e. can you read the module definition and get the value then load the control accordingly.

or is it going to be to much aggravation to try and write a module that supports popups and non popup?


I suspected the best answer is to probably stay away from them as you have confirmed. So the best thing for me to do is to set the popup property in the module definition for every control to be supports popups = false?

Also, thanks for the code snippet. Very useful.

 
New Post
10/31/2013 5:54 AM
 
You can look at the portalsettings to see if popups are enabled globally

if (PortalSettings.EnablePopUps)
{
}

And you could look at module info to see if popups are active for the current module.
But this is a little more complex as the Supports popup information is stored separately for each control in you module
- do if you have a View control and an Edit control for example each has its own settings.

ModuleController mc = new ModuleController();
ModuleInfo moduleInfo = mc.GetTabModule(TabModuleId);
String controlKey = "View"; // get the info for the View control of the current tabmoduleid.
ModuleControlInfo moduleControlInfo = ModuleControlController.GetModuleControlByControlKey (controlKey, moduleInfo.ModuleDefID);
if( moduleControlInfo.SupportsPopUps)
{
}

BUT having said all this - the only time you would need to be changing what a button looks like is when the module in question is being rendered.

It then that you need to do different things - its when a module IS being displayed in a popup that you want things to work differently.
And as such - you can test that by simply looking at the querystring at runtime and testing for popup=true. Thats the only point where you should
ever really care what action a button needs to take.

Westa
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedError when trying to load the edit.ascx controlError when trying to load the edit.ascx control


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