Solved

MasterPage Issues

Posted on 2007-04-08
4
698 Views
Last Modified: 2013-11-26
I'm a newbie at VS2005 ASP.NET development and am trying to build a website using the new MasterPage feature that will provide for three frames; header, navigation, content. In the old days I would create a FrameSet page and then maniplulate the contents of each frame in code.

Not sure how to do that in the new MasterPage feature buit I suspect that it has something to do with a ContentPlaceHolder. The problem I'm having is that I cannot arrange the ContentPlaceHolders to effect of a narrow header at the top, a narrow navigation panel to th left and a large content panel taking the rest of the page.

When I drop a ContentPlaceHolder on the MaserPage it simply shows up and I cannot move or size it at all.

Not sure what I'm doing wrong and would sure appreciate any guidance.

Thank you, stullhe104
0
Comment
Question by:stullhe104
  • 2
4 Comments
 
LVL 26

Expert Comment

by:Rejojohny
ID: 18874197
no need of frames.. the code in the master page woild have code as you would normally write while creating tables with the similar layout as u have mentioned above .. just change the width of the cells to the widths that you would like .. the contenplaceholder will take the complete space of the cell where it is placed .. no need to resize it in the master page

Rejo
0
 
LVL 6

Accepted Solution

by:
sankar_ravi earned 250 total points
ID: 18874855
Hi, May be try something like this...

<%@ master language="C#" %>
<script runat="server" language="c#">

</script>

<html>
<head id="Head1" runat="server">
    <title>Master Page</title>
</head>
<body>
    <form id="Form1" runat="server">
        <table id="header" style="WIDTH: 100%; HEIGHT: 80px" cellspacing="1" cellpadding="1" border="1">
            <tr>
                <td width="100%" style="TEXT-ALIGN: center">
                    This is the header from the Master Page
                </td>
            </tr>
        </table>
        <b/>
         <table id="leftNav" style="WIDTH: 108px; HEIGHT: 100%" cellspacing="1" cellpadding="1" border="1">
            <tr>
                <td style="WIDTH: 100px"> Left Navigation
                </td>
            </tr>
            </table>                                
        <table id="mainBody" style="LEFT: 120px; VERTICAL-ALIGN: top; WIDTH: 848px; POSITION: absolute; TOP: 94px; HEIGHT: 100%" border="1">
            <tr>
                <td width="100%" style="VERTICAL-ALIGN: top">                
                    <asp:contentplaceholder id="middleContent" runat="Server"></asp:contentplaceholder>                
                </td>
            </tr>
        </table>
    </form>
</body>
</html>

Thanks.

0
 

Author Comment

by:stullhe104
ID: 18875168
Thanks for the coding example Ravi. It helped a lot and I seem to be on-track now.
Stullhe104
0
 
LVL 6

Expert Comment

by:sankar_ravi
ID: 18880422
I am glad that it helped you.
Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now