Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,
My prob is this. I have a Master page in which I am having two content place holders one for master page and another for content page asusually.
In my master page's content place holder I have a menu. I want it to be always on left side of my page and conetnt page too as we have seen in many websites For eg. Facebook.
HTML
<head runat="server">
    <title>Untitled Page</title>
    <asp:ContentPlaceHolder ID="head" runat="server" >
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <div>
            <table width="100%">
                <tr>
                    <td>
                        <asp:Label ID="lblUsername" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td style="width: 100px;" align="right">
                        <asp:LinkButton ID="lnkLogOut" runat="server" OnClick="lnkLogOut_Click" CausesValidation="False">Log Out</asp:LinkButton>
                    </td>
                </tr>
            </table>
        </div>
        <div style:"width: 100px" align="left" >
            <asp:Panel ID="pn_SuperAdmin" runat="server">
                <table>
                    <tr>
                        <td valign = "top" bgcolor="#eeeeee">
                            <asp:Menu ID="Menu_SUPER_ADMIN" runat="server">
                                <Items>
                                    <asp:MenuItem NavigateUrl="~/myAccount.aspx" Text="Home" ToolTip="Click to go on MY ACCOUNT page"
                                        Value="Home"></asp:MenuItem>
                                    <asp:MenuItem Text="Add Client" Value="Add Client" NavigateUrl="~/Add_New_Client.aspx">
                                    </asp:MenuItem>
                                    <asp:MenuItem Text="Edit Client" Value="Edit Client" NavigateUrl="~/edit_Client_Info.aspx"
                                        ToolTip="Click here to edit existing Client's Personal Information"></asp:MenuItem>
                                    <asp:MenuItem Text="Change Password" Value="Change Password" NavigateUrl="~/change_password.aspx"
                                        ToolTip="Click here to change your Password"></asp:MenuItem>
                                    <asp:MenuItem NavigateUrl="~/Add_Edit_Normal_Admin.aspx" Text="Add/Edit Normal Admin"
                                        ToolTip="Click here to add Normal Admin" Value="Add/Edit Normal Admin"></asp:MenuItem>
                                    <asp:MenuItem></asp:MenuItem>
                                    <asp:MenuItem NavigateUrl="~/Add_Edit_Super_Admin.aspx" Text="Add/Edit Super Admin"
                                        Value="Add/Edit Super Admin"></asp:MenuItem>
                                    <asp:MenuItem Text="Create Query" 
                                        ToolTip="Click here to Create Query for Offline Data" Value="Create Query" 
                                        NavigateUrl="~/Query_For_Admin.aspx">
                                    </asp:MenuItem>
                                </Items>
                            </asp:Menu>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pn_NormalAdmin" runat="server">
                <table>
                    <tr>
                        <td>
                            <asp:Menu ID="Menu_NORMAL_ADMIN" runat="server">
                                <Items>
                                    <asp:MenuItem NavigateUrl="~/myAccount_Admin.aspx" Text="Home" ToolTip="Click to go on MY ACCOUNT page"
                                        Value="Home"></asp:MenuItem>
                                    <asp:MenuItem Text="Add Client" Value="Add Client" NavigateUrl="~/Add_New_Client.aspx">
                                    </asp:MenuItem>
                                    <asp:MenuItem Text="Edit Client" Value="Edit Client" NavigateUrl="~/edit_Client_Info.aspx"
                                        ToolTip="Click here to edit existing Client's Personal Information"></asp:MenuItem>
                                    <asp:MenuItem Text="Change Password" Value="Change Password" NavigateUrl="~/change_password.aspx"
                                        ToolTip="Click here to change your Password"></asp:MenuItem>
                                    <asp:MenuItem Text="Create Query" 
                                        ToolTip="Click here to create Query for Offline Data" Value="Create Query" 
                                        NavigateUrl="~/Query_For_Admin.aspx">
                                    </asp:MenuItem>
                                </Items>
                            </asp:Menu>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pn_CLEINT" runat="server">
                <table>
                    <tr>
                        <td>
                            <asp:Menu ID="Menu_CLEINT" runat="server">
                                <Items>
                                    <asp:MenuItem Text="Change Password" Value="Change Password" NavigateUrl="~/change_password.aspx"
                                        ToolTip="Click here to change your Password"></asp:MenuItem>
                                </Items>
                            </asp:Menu>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body
Posted
Updated 4-May-12 2:02am
v2

1 solution

hi I added some css for page, LeftMenu and Content
please check
ASP.NET
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <asp:contentplaceholder id="head" runat="server" xmlns:asp="#unknown">
    </asp:contentplaceholder>
    <style>
        #wraper
        {
            width: 100%;
            padding: auto;
            margin: auto;
        }
        #leftMenu
        {
            width: 40%;
            float: left;
            padding: auto;
            margin: auto;
        }
        #Content
        {
            width: 60%;
            float: right;
            padding: auto;
            margin: auto;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
    </asp:scriptmanager>
    <div id="wraper">
        <table width="100%">
            <tr>
                <td>
                    <asp:label id="lblUsername" runat="server" text="Label" xmlns:asp="#unknown"></asp:label>
                </td>
                <td style="width: 100px;" align="right">
                    <asp:linkbutton id="lnkLogOut" runat="server" onclick="lnkLogOut_Click" causesvalidation="False" xmlns:asp="#unknown">Log Out</asp:linkbutton>
                </td>
            </tr>
        </table>
        <div id="leftMenu">
            <asp:panel id="pn_SuperAdmin" runat="server" xmlns:asp="#unknown">
                <table>
                    <tr>
                        <td valign="top" bgcolor="#eeeeee">
                            <asp:menu id="Menu_SUPER_ADMIN" runat="server">
                                <items>
                                    <asp:menuitem navigateurl="~/myAccount.aspx" text="Home" tooltip="Click to go on MY ACCOUNT page">
                                        Value="Home"></asp:menuitem>
                                    <asp:menuitem text="Add Client" value="Add Client" navigateurl="~/Add_New_Client.aspx">
                                    </asp:menuitem>
                                    <asp:menuitem text="Edit Client" value="Edit Client" navigateurl="~/edit_Client_Info.aspx">
                                        ToolTip="Click here to edit existing Client's Personal Information"></asp:menuitem>
                                    <asp:menuitem text="Change Password" value="Change Password" navigateurl="~/change_password.aspx">
                                        ToolTip="Click here to change your Password"></asp:menuitem>
                                    <asp:menuitem navigateurl="~/Add_Edit_Normal_Admin.aspx" text="Add/Edit Normal Admin">
                                        ToolTip="Click here to add Normal Admin" Value="Add/Edit Normal Admin"></asp:menuitem>
                                    <asp:menuitem></asp:menuitem>
                                    <asp:menuitem navigateurl="~/Add_Edit_Super_Admin.aspx" text="Add/Edit Super Admin">
                                        Value="Add/Edit Super Admin"></asp:menuitem>
                                    <asp:menuitem text="Create Query" tooltip="Click here to Create Query for Offline Data">
                                        Value="Create Query" NavigateUrl="~/Query_For_Admin.aspx"></asp:menuitem>
                                </items>
                            </asp:menu>
                        </td>
                    </tr>
                </table>
            </asp:panel>
            <asp:panel id="pn_NormalAdmin" runat="server" xmlns:asp="#unknown">
                <table>
                    <tr>
                        <td>
                            <asp:menu id="Menu_NORMAL_ADMIN" runat="server">
                                <items>
                                    <asp:menuitem navigateurl="~/myAccount_Admin.aspx" text="Home" tooltip="Click to go on MY ACCOUNT page">
                                        Value="Home"></asp:menuitem>
                                    <asp:menuitem text="Add Client" value="Add Client" navigateurl="~/Add_New_Client.aspx">
                                    </asp:menuitem>
                                    <asp:menuitem text="Edit Client" value="Edit Client" navigateurl="~/edit_Client_Info.aspx">
                                        ToolTip="Click here to edit existing Client's Personal Information"></asp:menuitem>
                                    <asp:menuitem text="Change Password" value="Change Password" navigateurl="~/change_password.aspx">
                                        ToolTip="Click here to change your Password"></asp:menuitem>
                                    <asp:menuitem text="Create Query" tooltip="Click here to create Query for Offline Data">
                                        Value="Create Query" NavigateUrl="~/Query_For_Admin.aspx"></asp:menuitem>
                                </items>
                            </asp:menu>
                        </td>
                    </tr>
                </table>
            </asp:panel>
            <asp:panel id="pn_CLEINT" runat="server" xmlns:asp="#unknown">
                <table>
                    <tr>
                        <td>
                            <asp:menu id="Menu_CLEINT" runat="server">
                                <items>
                                    <asp:menuitem text="Change Password" value="Change Password" navigateurl="~/change_password.aspx">
                                        ToolTip="Click here to change your Password"></asp:menuitem>
                                </items>
                            </asp:menu>
                        </td>
                    </tr>
                </table>
            </asp:panel>
        </div>
        <div id="Content">
            <asp:contentplaceholder id="ContentPlaceHolder1" runat="server" xmlns:asp="#unknown">
            </asp:contentplaceholder>
        </div>
    </div>
    </form>
</body>
</head>
 
Share this answer
 
Comments
Taresh Uppal 4-May-12 8:23am    
That was it...Thanx a lot..With little editing it is acceptable by my boss !!!
Thanx a lot
tanweer 4-May-12 8:28am    
i am glad that it help you

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