DotNetNuke Container visibility

maxworx
maxworx used Ask the Experts™
on
Hi all,

is it possible to blind out a container if the content of the module in this container is empty in DotNetNuke?

Thanks a lot for any ideas.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I guess, you mean that if for example you have some data in a grid in your module and somehow when this grid has no rows (just for example), you want the module and its container to disappear??

Well if its the case this should be easy, just check in your code if you found no data, just hide the module ascx control. Let me know if its not what you are looking out for.
Happy Coding!
By dnn control panel is not possible.
It is possible hide or show the container but not depending on content also because modules behavior could be very different so dnn framework hasn't a standard mode to know if a generic module have content or not.

Commented:
Hi all,

thanks a lot for the comments.

@paololabe:
Thank you for your comment, it is right that this can not be handled over the control panel, it has to be handled in the module.

@techExtreme:
Your comment is not the whole solution, but the right way.
I do not have to hide the module ascx, I have to hide the conatiner.

If I hide the module ascx the container is still there, but if I hide the container the container and all in is hidden.

Here the solution:
// Hide the module ascx
this.Visible = true;
 
// Hide a container
this.ContainerControl.Visible = true;

Open in new window

Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Ya that's correct. Although this may not be the most optimal solution but for most of us, untill it is directly available, this quick fix will do. :)
Well if you want to award points,  you need to explicitly do it. As you can see you are directly closing the question without assigning points.

Author

Commented:
Hi techExtreme,

I awarded the points, I'm sure.

As you can see in the "Close request", I accept my comment as solution without points and your comment as assistant solution with 500 points.

Thanks again for all the help!
no probs. Thanks :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial