Click here to Skip to main content
15,917,702 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have master page and content page....i want to set my content page data in the middle...and also want to know how to maky the contentplaceholder in master page absolute position

What I have tried:

master page:


<asp:ContentPlaceHolder ID="content" runat="server">



content page:

<asp:Content ID= "Content1" ContentPlaceHolderID = "content"
runat="server"> <link rel="stylesheet" href="css/StyleSheet.css" type="text/css" media="screen" />
.........
...........
............

Posted
Comments
[no name] 9-Feb-16 6:23am    
Do you want to display the content in center of browser? Please describe.

1 solution

Your content pages don't have any mark-up that is sent to the client (other than the mark-up you add yourself), they are simply a server-side container for your controls. If you want to centre your content you'll need to wrap your content placeholder in a div with the appropriate css

C#
#content{
    position: fixed;
    /* center the element */
    right: 0;
    left: 0;
    margin-right: auto;
    margin-left: auto;
    /* give it dimensions */
    min-height: 10em;
    width: 90%;
}


On your master page

ASP.NET
<div id="content">
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        
    </asp:ContentPlaceHolder>
</div>
 
Share this answer
 
v2

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