asp.NET MASTER PAGES QUESTION

J

Just Me

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 ?
 
M

Mark Rae

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 said:
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...
 
J

Just Me

OK Standbye for code.

Mark Rae said:
It doesn't have to be... None of my MasterPages surrounds the content


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


Impossible to tell unless you show us the code...
 
J

Just Me

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>
 
M

Mark Rae

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...
 
J

Just Me

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.
 
M

Mark Rae

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...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top