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...Skins, Themes, ...Skins, Themes, ...DIV ModuleContent helpDIV ModuleContent help
Previous
 
Next
New Post
3/1/2007 1:52 PM
 

For those who have checked the html source of a dnn site, have noticed that a module is going to be inside a
<td id=contentpane> then a <Div id=dnn_ctr382_ModuleContent>    then a Module.

But the DIV is affecting my layout, would anyone know how to affect height:100%  to that DIV?

Help Thx.

 
New Post
3/2/2007 6:25 PM
 
Normally this div shouldn't affect your layout, so my guess is that it picks up some CSS from up the DOM.
If you want to set the height to 100%:

#dnn_contentpane div{
    width:100%
}

But the div below it wil inherit this...
And

#dnn_contentpane > div{
    width:100%
}
Doesn't work in all IE versions
 
New Post
2/11/2010 1:10 PM
 

I discovered this little problem myself. Even though it's been a while, I thought I would post my solution. If you require that a <DIV> container have "height: 100%;," it is necessary to have its parents up the tree all be 100%. The trouble, as noted, is that this hidden "ModuleContent" <DIV> is not sized.

The "ModuleContent" <DIV" tag, with an ID something like "DNN_ctr123_ModuleContent," shares that "ctr123" with its parent, which is the Module Container. You cannot get to the ModuleContent object from code, but you CAN get to the module's container, and get its Client ID. So use the Container's Client ID to "derive" the "ModuleContent" object's Client ID.

In the module's code-behind, its immediate parent object (Me.Parent) is the Container. The Container's Client ID is of the format, "dnn_ctr123_ContentPane." All we want is the "ctr123" from its ID. Split the Client ID by the underscore characters, and take the second item from the resulting array. That is the "ctr123."

In the .ascx of my module, I put in this STYLE block--

<style type="text/css" >
    div#<%= ModuleContentDivID() %> {
        height: 100%;
    }   
</style>

 Then, in the code-behind--

Protected Function ModuleContentDivID() As String
       Dim ctr As String = Me.Parent.ClientID.Split("_")(1)
       Return String.Format("dnn_{0}_ModuleContent", ctr)
End Function

This gets the Container's Client ID, strips out the "ctr" block, and plugs it into the string "dnn_<here>_ModuleContent." This is the ModuleContent <DIV>'s Client ID.

Now when you view source on the page, you will have something like this--

<div id="dnn_ctr375_ModuleContent" class="MyModuleContent">

<style type="text/css" >
div#dnn_ctr375_ModuleContent {
height: 100%;
}
</style>
...
</div>

And now the Module's content can expand up to 100% height.

 
New Post
2/12/2010 12:25 AM
 

This line of Javascript or something close might also work:

$('#<%= Parent.ClientID %>').parent().css('height', '100%');

Nik

 


Nik Kalyani
Co-founder
DotNetNuke Corporation
Blog | Twitter | FaceBook
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...DIV ModuleContent helpDIV ModuleContent help


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