[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

Master page with DIVS in ASP.Net

Greetings all

I have a standard design for an application which consists of the usual header, followed bya  "body" which has two columns and underneath that a footer.  

If teh right column is shorter then the left, then the "footer" floats up under the right, alongside the left. I can get aroiund this by setting lengths fo both columns.

Problem is that this layout is the same for many pages and thus makes sense to do a a MatserPage. If that is so, how do I set the Div lengths, which will vary from page to page? And, is there nbot a better wya to do this?

In advance, thanks!!

   allanmark
0
allanmark
Asked:
allanmark
  • 7
  • 4
  • 2
1 Solution
 
Anurag ThakurCommented:
i will suggest you to define your master page in the following manner
this will make sure that your divs will render in correct place

<table>
   <tr>
      <td colspan=2>
           HEADER
      </td>
    </tr>
   <tr>
      <td>
          Right Column
      </td>
      <td>
           Left Column
      </td>
    </tr>
      <td colspan=2>
           Footer
      </td>
    </tr>
</table>
0
 
allanmarkAuthor Commented:
Sorry ... what I should have also sais was ....

Each page will have different content for BOTH the left and teh right columns.
0
 
Anurag ThakurCommented:
master page will just have the content place holders and the aspx pages inheriting from the master page will implement the content place holders so the rendering will be as required
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
daveamourCommented:
It is more acceptable these days to avoid tables for layout like this and use CSS instead eg:
http://www.strictlycss.com/examples/three-column-layout-9.asp
 
0
 
allanmarkAuthor Commented:
I'm happy with the concept of CSS.

What I am not to sure of is how to handle the different column lengths in the various pages.
0
 
daveamourCommented:
Columns should resize to accommodate the content within them.
0
 
allanmarkAuthor Commented:
Sorry ... I'm really getting myself knotted up .. what I meant was ...

Two DIVS / columns (left and right), with left set as "float: left" and  a DIV as a footer underneath -- if teh right column has less content then the footer scrolls up underneath it, alongside the left. I can't figure out the css to stop this.
0
 
daveamourCommented:
Ok I see
I'm not bad with CSS but not an expert.  You will have a better chance posting this in the CSS area:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/
 
 
0
 
allanmarkAuthor Commented:
Got it! Had a look at the site and followed a link.

The answer - enacse the lot in a wrapper div:-

      <div id="wrapper">       
        
          <div id="left" class="leftnav">      
                   <asp:ContentPlaceHolder ID="leftnav" runat="server">
                </asp:ContentPlaceHolder>
           </div>
       
           <div id="right" class="rightnav">      
              <asp:ContentPlaceHolder ID="righnav" runat="server">
              </asp:ContentPlaceHolder>
          </div>
     
      <!-- <div id="wrapper">        -->
      </div>

0
 
allanmarkAuthor Commented:
Sorry! Doesn't work!  -- I hadn't done a refresh!!
0
 
allanmarkAuthor Commented:
Working!  Just needed to adjust a few things!

For interest sake:

http://imaginekitty.com/phonyBorders/phonyBorders.html  -- ha a look at source view and got what I needed!
0
 
daveamourCommented:
Nice one
0
 
allanmarkAuthor Commented:
Points are yours - your site suggestion led to the solution!  Thank you!!
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 7
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now