Greetings people. I'm not new to this place. I've been visiting the forums frequently and have learned a lot of things just by observing the solutions of different people's problems. This is such a wonderful place to be. I thank the creators, staff members and the people who have been helping others all this time.

For the last 2-3 months, I've been reading books on C#,ASP.Net, SQL Server. After going through them, I've decided to start a dummy project. I plan to make a random website and see where I stand on the subject.

As the first step, I designed a Master Page for my website. Everything seems to be in order. My master page has a table with 3 rows.

In the first row, I've put up a banner for the website.
The second row has been divided into 5 cells for a navigation Menu.
In the third row, I want to place the ContentPlaceHolder.

The thing is that I cant make the ContentPlaceHolder to occupy the whole cell. I tried finding the solution through search engines and found out that using 'Div' control can solve the problem.

So I put in a 'Div' control from the toolbox into the third row of the table and set its width to 100% and height to 350px. Then, I dragged a ContentPlaceHolder in the 'Div' control. Just like the code below.

<div style="width: 100%; height: 350px;">
<asp:ContentPlaceHolder id=contentplaceholder1></asp:ContentPlaceHolder>
</div>

Unfortunately, there is still some gap left at the bottom of the ContentPlaceHolder. I mean, it has taken the entire width of the div control but the height of the ContentPlaceHolder is around 300 px.

Any ideas/solutions on how to make it occupy the entire height of the div control?

Thanks in advance.

>Resizing ContentPlaceHolder in Master Page.

You can't. Because it has no user interface or html markup. ContentPlaceHolder allow us to declare the portion of page where we can insert custom/page-specific content.

So nothing can be done about the little gap inbetween the ContentPlaceHolder and the Div control?

>So nothing can be done about the little gap inbetween the ContentPlaceHolder and the Div control?

Padding & Margin CSS attributes.

No no. Its not about padding/margin. I think I wasnt clear. The div control has taken up the entire cell. So no problem there. But when I insert a ContentPlaceHolder inside the div control, there is a gap of around 50 px in between the div control and the contentplaceholder. Hold on a sec, I'll try to upload the screenshot.

Damn! I cant get the screenshot as I'm working on Visual Studio through Virtual PC. It doesnt even let me use the 'Print Screen' button.

Btw, how do I edit my posts? I didnt want to double post but I dont see any 'Edit' function in my posts.

Its ok. I dont seem to get around this problem. Nevermind. Thanks for taking out time and replying back. This thread may be closed now.

>But when I insert a ContentPlaceHolder inside the div control, there is a gap of around 50 px in between the div control and the contentplaceholder.

Maybe your .master markup has extra space or line break (&nbsp; br).
Have look at .master and .aspx markup.

.master markup

<head runat="server">
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <style type="text/css">
       .Outer 
       {
       	border:solid 1px red;
       }
       .Inner
       {
       	border:solid 1px black;
       	height:200px;
       }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="Outer">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

.aspx (content) page

<%@ Page Title="Sample" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="Inner">
</div>
</asp:Content>

what I did for the height was give enough enter into the contentplaceholder and that made it big enough

To change the size of your asp.net page, locate the div tag "page" in your master page and override the css styling inside the very div tag like so:

<div class="page" style="width: 80%">

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.