asp.NET MASTER PAGES QUESTION

Discussion in 'ASP .Net' started by Just Me, Jan 21, 2007.

  1. Just Me

    Just Me Guest

    Hi,

    I have build a header and footer control which I want to add to my master
    page, so in essence I want the header, a contact placeholder and a footer.

    This is something I used to do with vs2003 all the time and never had any
    problems.

    In vs2005 using master pages, I see the content placeholder is in a div tag.
    So I add another before and after to hold my controls.

    The problem is that the Content placeholder allways goes up the page and
    lies on top of my header control, event if I set the dive tags to relative
    position.

    What am I doing wrong ?
     
    Just Me, Jan 21, 2007
    #1
    1. Advertising

  2. Just Me

    Mark Rae Guest

    "Just Me" <news.microsoft.com> wrote in message
    news:...

    > In vs2005 using master pages, I see the content placeholder is in a div
    > tag.


    It doesn't have to be... None of my MasterPages surrounds the content
    placeholder in a <div>...

    > So I add another before and after to hold my controls.


    Why...?

    > The problem is that the Content placeholder allways goes up the page and
    > lies on top of my header control, event if I set the dive tags to relative
    > position.


    Sounds like you have placed the controls in your content page within a div
    with an absolute position...

    > What am I doing wrong ?


    Impossible to tell unless you show us the code...
     
    Mark Rae, Jan 21, 2007
    #2
    1. Advertising

  3. Just Me

    Just Me Guest

    OK Standbye for code.

    "Mark Rae" <> wrote in message
    news:...
    > "Just Me" <news.microsoft.com> wrote in message
    > news:...
    >
    >> In vs2005 using master pages, I see the content placeholder is in a div
    >> tag.

    >
    > It doesn't have to be... None of my MasterPages surrounds the content
    > placeholder in a <div>...
    >
    >> So I add another before and after to hold my controls.

    >
    > Why...?
    >
    >> The problem is that the Content placeholder allways goes up the page and
    >> lies on top of my header control, event if I set the dive tags to
    >> relative position.

    >
    > Sounds like you have placed the controls in your content page within a div
    > with an absolute position...
    >
    >> What am I doing wrong ?

    >
    > Impossible to tell unless you show us the code...
    >
     
    Just Me, Jan 21, 2007
    #3
  4. Just Me

    Just Me Guest

    Even if I only look at the master page, the content placeholder overlaps the
    generic header. If you need to see the header control let me know

    <%@ Master Language="VB" AutoEventWireup="false"
    CodeBehind="General.master.vb" Inherits="WATest.General" %>

    <%@ Register Src="controls/GenericHeader.ascx" TagName="GenericHeader"
    TagPrefix="uc1" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <div style="position:relative">

    <uc1:GenericHeader ID="GenericHeader1" runat="server" />

    </div>

    <div style="position:relative">


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

    </asp:ContentPlaceHolder>

    </div>

    </form>

    </body>

    </html>

    "Mark Rae" <> wrote in message
    news:...
    > "Just Me" <news.microsoft.com> wrote in message
    > news:...
    >
    >> In vs2005 using master pages, I see the content placeholder is in a div
    >> tag.

    >
    > It doesn't have to be... None of my MasterPages surrounds the content
    > placeholder in a <div>...
    >
    >> So I add another before and after to hold my controls.

    >
    > Why...?
    >
    >> The problem is that the Content placeholder allways goes up the page and
    >> lies on top of my header control, event if I set the dive tags to
    >> relative position.

    >
    > Sounds like you have placed the controls in your content page within a div
    > with an absolute position...
    >
    >> What am I doing wrong ?

    >
    > Impossible to tell unless you show us the code...
    >
     
    Just Me, Jan 21, 2007
    #4
  5. Just Me

    Mark Rae Guest

    "Just Me" <news.microsoft.com> wrote in message
    news:%...

    > Even if I only look at the master page, the content placeholder overlaps
    > the generic header. If you need to see the header control let me know


    Firstly, there's no need to maintain your GenericHeader as a UserControl -
    that's the whole point of a MasterPage, but that shouldn't be causing your
    layout problems per se...

    The first thing I would try is to remove the GenericHeader control and
    replace it with some text. Then, remove the <div> tag from around your
    content placeholder and check that it does not overlap the text where the
    GenericHeader control used to be...
     
    Mark Rae, Jan 21, 2007
    #5
  6. Just Me

    Just Me Guest

    Hi Mark,

    Ive found the problem, the generic header elements were absolutely
    positioned, so I simply offset the div tag from normal flow by a said amount
    and that did the trick.

    I take your point about controls and master pages, but there may be several
    situations where I want to alter the master pages,and I dont want to have to
    re-create the menu and header graphics etc, so thats why I am taking this
    approach.

    Thank for your time.


    "Mark Rae" <> wrote in message
    news:%...
    > "Just Me" <news.microsoft.com> wrote in message
    > news:%...
    >
    >> Even if I only look at the master page, the content placeholder overlaps
    >> the generic header. If you need to see the header control let me know

    >
    > Firstly, there's no need to maintain your GenericHeader as a UserControl -
    > that's the whole point of a MasterPage, but that shouldn't be causing your
    > layout problems per se...
    >
    > The first thing I would try is to remove the GenericHeader control and
    > replace it with some text. Then, remove the <div> tag from around your
    > content placeholder and check that it does not overlap the text where the
    > GenericHeader control used to be...
    >
     
    Just Me, Jan 21, 2007
    #6
  7. Just Me

    Mark Rae Guest

    "Just Me" <news.microsoft.com> wrote in message
    news:...

    > Ive found the problem, the generic header elements were absolutely
    > positioned, so I simply offset the div tag from normal flow by a said
    > amount and that did the trick.


    Cool.

    > I take your point about controls and master pages, but there may be
    > several situations where I want to alter the master pages,and I dont want
    > to have to re-create the menu and header graphics etc, so thats why I am
    > taking this approach.


    Er, OK...
     
    Mark Rae, Jan 21, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Electrified Research
    Replies:
    5
    Views:
    2,469
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 11, 2005
  2. Doug McCann
    Replies:
    1
    Views:
    1,044
    William Brogden
    Aug 5, 2004
  3. Replies:
    1
    Views:
    3,224
    PeterKellner
    May 16, 2006
  4. =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==

    Disabling Browser Cache on ASP.NET Pages That Use Master Pages

    =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==, Aug 2, 2006, in forum: ASP .Net
    Replies:
    11
    Views:
    15,129
    Juan T. Llibre
    Aug 12, 2006
  5. Annie
    Replies:
    4
    Views:
    704
    Annie
    Apr 24, 2007
Loading...

Share This Page