Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to create a web based application. This web based application it should have Header, Main Contet which is separated in three other
like Left, Center and Right.
At the end it has a footer to.
In the left DIV i want to put site links, in center one the content of a page and in the right div i want to put some news.
The problem is that i know how to create nested div-s in HTML but I don#t know where to place the div-s I create in site.master.
If I place the div-s at main content it places them under the content, not in the same line of content.
I hope someone can help me to solve this problem.
Here is some code I try:
C#
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="ScoMan.SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form runat="server">
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                    My ASP.NET Application
                </h1>
            </div>
            <div class="loginDisplay">
                <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                    <AnonymousTemplate>
                        [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus"  runat="server">Log In</a> ]
                    </AnonymousTemplate>
                    <LoggedInTemplate>
                        Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                        [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
                    </LoggedInTemplate>
                </asp:LoginView>
            </div>
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                    </Items>
                </asp:Menu>
                  
            </div>
        </div>
        <div class="main">
        

            <asp:ContentPlaceHolder ID="MainContent" runat="server"/>

            <div id="majtas">
        <asp:Menu ID="Menu1" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Vertical">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                    </Items>
                </asp:Menu>
        </div>
        </div>
        
        <div class="clear">
        </div>
    </div>
    <div class="footer">
        
    </div>
    </form>
</body>
</html>

As you can see the vertical menubar is places under the content of page.
Thank you in advance for your reply.
Posted
Comments
Sergey Alexandrovich Kryukov 18-Apr-13 15:50pm    
Sorry, not a question.
—SA

1 solution

If you really want that design, why not use the HTML <table> Tag[^]?

Best regards
Espen Harlinn
 
Share this answer
 
Comments
fjdiewornncalwe 18-Apr-13 16:19pm    
My 5. I'm not sure why so many people consider the use of a table bad now... Sometimes it just works so much better than divs...
Espen Harlinn 18-Apr-13 16:20pm    
Thank you, Marcus ;)
jkirkerx 19-Apr-13 1:27am    
I still use tables, call me old school, but they work great, and offer lots of flexibility in dimensioning.
Sergey Alexandrovich Kryukov 25-Apr-13 18:50pm    
Oh, you think that, too? I always though depreciation of table is some kind of myth circulating between Web designers...
—SA
jkirkerx 18-Apr-13 16:55pm    
You really need to create a wireframe of your master page first, just empty containers, and refine the design until your satisfied. Then you go back and add your content inside each container one at a time, and finally add your content placement containers.

Use Tables, rows and cells at first, it's easier to start with,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900