Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2007, 02:05 PM
Authorized User
 
Join Date: Jan 2007
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with locating Content PlaceHolders

I'm new to asp.net and am having trouble position the content placeholder in the location that I want it to be, I can't seem to find any guidance of how this is done text book. AT present I have used the same technigue inside the book.

on my stylesheet I have
#content
{
    margin-left: 230px;
    padding: 0 10px 1.8em 20px;
    background-color: #fff;
}
html>body #content {
    width: 218px;
}



.centreContent {
    padding-bottom: 1.8em;
}

an on the masterpage

 <div id ="content">
        <div class="centrecontent">
            <h2><asp:Label ID="titlePage" runat="server" Text="Home"></asp:Label></h2>
             <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
            </asp:contentplaceholder>
            </div>


            <div id="addressroute" style="float:right">
                    <asp:SiteMapPath ID="SiteMapPath1" runat="server">
                    </asp:SiteMapPath>
            </div>
        </div>

Could someone please advise what I need to do to position the place holder where I want it

 
Old January 17th, 2007, 02:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Nichola,

Don't bother trying to position the content placeholder. It renders no markup in the page, so there *is* nothing to position.

Instead, put the ContentPlaceHolder inside an element that can be positioned, like a <div> tag.

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old January 17th, 2007, 03:36 PM
Authorized User
 
Join Date: Jan 2007
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for you help but I managed to get the class way working.

 
Old January 17th, 2007, 03:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, but that means that you positioned the outer centrecontent <div> either as .centrecontent or #centrecontent, not the actual ContentPlaceHolder, right? (Although, as a side effect, that one is positioned as well).

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
BOF locating. Bronte Access VBA 5 March 4th, 2008 08:55 AM
FilterExpression multiple parameters/placeholders NigelBronson ASP.NET 2.0 Basics 0 September 27th, 2006 04:57 PM
MySQL Parameter Placeholders bluewavestrider ASP.NET 2.0 Basics 0 July 28th, 2006 11:29 AM
Locating n measuring component in an image RichardRose C# 0 October 8th, 2003 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.