472,986 Members | 2,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

Master Pages: Why is all of my content centered?

I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?

Jan 26 '07 #1
7 1972
either in master, or in css
On Jan 26, 8:31 pm, "TheLongshot" <TheLongs...@gmail.comwrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?
Jan 26 '07 #2
TheLongshot wrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?
Unfortunately, it's impossible to give you a detailed response without
seeing your code and/or markup. Your best bet is to look at the
rendered HTML or the CSS for your page(s). More than likely you have
something in there that you're not expecting.

At any rate, it's most likely not related to master pages, per se.

Hope that helps,

--
Sean

website: http://senfo.blogspot.com
Jan 26 '07 #3
Well, if I do, it is hiding from me. I didn't change any of the
markup, yet on every single page, the content is centered.

The body of my master page:

<body bgcolor="#ececec" leftmargin="0" topmargin="0"
onbeforeunload="javascript: if (bDirty && !IgnoreDirty) return 'You
have not saved your changes.';">
<form id="form1" runat="server">
<uc1:header id="Header1"
runat="server"></uc1:header><uc1:navigation id="Navigation1"
runat="server"></uc1:navigation>
<table width="95%" height="550" border="0" align="center"
cellpadding="0" cellspacing="1" ID="Table8">
<tr>
<td valign = "top">
<asp:contentplaceholder id="cpMain" runat="server" >
</asp:contentplaceholder>
</td>
</tr>
</table>
<uc1:footer id="Footer1" runat="server"></uc1:footer>
</form>
</body>

Just as a note, I did try removing everything from inside the body tag
except for the contentplaceholder and got the same result. There is
nothing in the css file that dictates style for the body tag (or any
tag for that matter).

Part of the default.aspx page:

<%@ Register TagPrefix="uc1" TagName="PageHistory"
Src="Controls/PageHistory.ascx" %>
<%@ Page language="c#" Inherits="T._default" CodeFile="default.aspx.cs"
MasterPageFile="TMaster.master" Title="T"%>
<asp:Content ID="Content1" runat="Server"
ContentPlaceHolderID="cpMain">
<table class="arrowBackground" id="Table11" height="550"
cellSpacing="0" cellPadding="0" Width="100%" bgColor="#ffffff"
border="0">
<tr>
<td width="20%" colSpan="3" style="height: 14px"></td>
</tr>
<tr>
<td vAlign="top" align="center" width="95%">
<asp:loginview runat="server"
id="LoginView1"><LoggedInTemplate>
<!-- BEGIN CONTENT AREA -->
<TABLE id="Table9" height=25
cellSpacing=0 cellPadding=0 width="75%" border=0
background="images/pageTitleTile25.gif">
<TBODY>
<TR>
<TD
align=left><uc1:pagehistory id="PageHistory" runat="server"
Initialize="True" Visible="True" Text="Main"></uc1:pagehistory</TD>

Removing the "center" align from the td tag above just left alignes the
cell. The content is still centered. Even tho the TD tag for the
pagehistory control is left justified, the pagehistory control is
centered when rendered.

css for "arrowBackround"

..arrowBackground {
background-image: url(images/backgroundArrow.gif);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center bottom;
}

I'm at a loss.

Jason
On Jan 26, 3:02 pm, senfo <enceladus...@yahoo.comI-WANT-NO-SPAMwrote:
TheLongshot wrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?Unfortunately, it's impossible to give you a detailed response without
seeing your code and/or markup. Your best bet is to look at the
rendered HTML or the CSS for your page(s). More than likely you have
something in there that you're not expecting.

At any rate, it's most likely not related to master pages, per se.

Hope that helps,

--
Sean

website:http://senfo.blogspot.com
Jan 26 '07 #4
Maybe this has something to with it......
<table width="95%" height="550" border="0" align="center"

Bob Lehmann

"TheLongshot" <Th*********@gmail.comwrote in message
news:11*********************@l53g2000cwa.googlegro ups.com...
Well, if I do, it is hiding from me. I didn't change any of the
markup, yet on every single page, the content is centered.

The body of my master page:

<body bgcolor="#ececec" leftmargin="0" topmargin="0"
onbeforeunload="javascript: if (bDirty && !IgnoreDirty) return 'You
have not saved your changes.';">
<form id="form1" runat="server">
<uc1:header id="Header1"
runat="server"></uc1:header><uc1:navigation id="Navigation1"
runat="server"></uc1:navigation>
<table width="95%" height="550" border="0" align="center"
cellpadding="0" cellspacing="1" ID="Table8">
<tr>
<td valign = "top">
<asp:contentplaceholder id="cpMain" runat="server" >
</asp:contentplaceholder>
</td>
</tr>
</table>
<uc1:footer id="Footer1" runat="server"></uc1:footer>
</form>
</body>

Just as a note, I did try removing everything from inside the body tag
except for the contentplaceholder and got the same result. There is
nothing in the css file that dictates style for the body tag (or any
tag for that matter).

Part of the default.aspx page:

<%@ Register TagPrefix="uc1" TagName="PageHistory"
Src="Controls/PageHistory.ascx" %>
<%@ Page language="c#" Inherits="T._default" CodeFile="default.aspx.cs"
MasterPageFile="TMaster.master" Title="T"%>
<asp:Content ID="Content1" runat="Server"
ContentPlaceHolderID="cpMain">
<table class="arrowBackground" id="Table11" height="550"
cellSpacing="0" cellPadding="0" Width="100%" bgColor="#ffffff"
border="0">
<tr>
<td width="20%" colSpan="3" style="height: 14px"></td>
</tr>
<tr>
<td vAlign="top" align="center" width="95%">
<asp:loginview runat="server"
id="LoginView1"><LoggedInTemplate>
<!-- BEGIN CONTENT AREA -->
<TABLE id="Table9" height=25
cellSpacing=0 cellPadding=0 width="75%" border=0
background="images/pageTitleTile25.gif">
<TBODY>
<TR>
<TD
align=left><uc1:pagehistory id="PageHistory" runat="server"
Initialize="True" Visible="True" Text="Main"></uc1:pagehistory</TD>

Removing the "center" align from the td tag above just left alignes the
cell. The content is still centered. Even tho the TD tag for the
pagehistory control is left justified, the pagehistory control is
centered when rendered.

css for "arrowBackround"

.arrowBackground {
background-image: url(images/backgroundArrow.gif);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center bottom;
}

I'm at a loss.

Jason
On Jan 26, 3:02 pm, senfo <enceladus...@yahoo.comI-WANT-NO-SPAMwrote:
TheLongshot wrote:
I just recently converted a few pages of my application to using
master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?Unfortunately, it's impossible to give you a detailed response
without
seeing your code and/or markup. Your best bet is to look at the
rendered HTML or the CSS for your page(s). More than likely you have
something in there that you're not expecting.

At any rate, it's most likely not related to master pages, per se.

Hope that helps,

--
Sean

website:http://senfo.blogspot.com

Jan 27 '07 #5
A MasterPage is essentially just another control, that merges into the Page
that uses it. So if you View Source on your generated pages, you'll be able
to see the markup that is making it "centered". It's all HTML and CSS, all
you need to do is find it and fix it, the Master probably has little to do
with the issue.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"TheLongshot" wrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?

Jan 27 '07 #6
Look at this

<td width="20%" colSpan="3" style="height: 14px"></td>
</tr>
<tr>
<td vAlign="top" align="center" width="95%">
<asp:loginview runat="server"
id="LoginView1"><LoggedInTemplate>
<!-- BEGIN CONTENT AREA -->
<TABLE id="Table9" height=25
cellSpacing=0 cellPadding=0 width="75%" border=0
20%+95%+.....{...} = ?

Try to correct %% manually, or resize that part in IDE. Maybe the
problem is here...
On Jan 27, 2:51 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
A MasterPage is essentially just another control, that merges into the Page
that uses it. So if you View Source on your generated pages, you'll be able
to see the markup that is making it "centered". It's all HTML and CSS, all
you need to do is find it and fix it, the Master probably has little to do
with the issue.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net

"TheLongshot" wrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?- Hide quoted text -- Show quoted text -
Jan 27 '07 #7
Ok, I finally found what was causing all of these problems.

At the !DocType directive, I saw this in addition to what I originally
had: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

Apparently, this is a newer definition of XHTML and totally screwed up
my pages when rendered in IE. I only found out about it because some
labels I had CSS on weren't using height and width. Found out with
the new definition, that width and Height no longer work in SPANs. I
hope Microsoft eventually changes the renders of labels to DIVs
instead of SPANs, or else this will break how some people want to use
a label.

Anyways, everything is back to normal in my application.

Jason

On Jan 26, 4:36 pm, "TheLongshot" <TheLongs...@gmail.comwrote:
Well, if I do, it is hiding from me. I didn't change any of the
markup, yet on every single page, the content is centered.

The body of my master page:

<body bgcolor="#ececec" leftmargin="0" topmargin="0"
onbeforeunload="javascript: if (bDirty && !IgnoreDirty) return 'You
have not saved your changes.';">
<form id="form1" runat="server">
<uc1:header id="Header1"
runat="server"></uc1:header><uc1:navigation id="Navigation1"
runat="server"></uc1:navigation>
<table width="95%" height="550" border="0" align="center"
cellpadding="0" cellspacing="1" ID="Table8">
<tr>
<td valign = "top">
<asp:contentplaceholder id="cpMain" runat="server" >
</asp:contentplaceholder>
</td>
</tr>
</table>
<uc1:footer id="Footer1" runat="server"></uc1:footer>
</form>
</body>

Just as a note, I did try removing everything from inside the body tag
except for the contentplaceholder and got the same result. There is
nothing in the css file that dictates style for the body tag (or any
tag for that matter).

Part of the default.aspx page:

<%@ Register TagPrefix="uc1" TagName="PageHistory"
Src="Controls/PageHistory.ascx" %>
<%@ Page language="c#" Inherits="T._default" CodeFile="default.aspx.cs"
MasterPageFile="TMaster.master" Title="T"%>
<asp:Content ID="Content1" runat="Server"
ContentPlaceHolderID="cpMain">
<table class="arrowBackground" id="Table11" height="550"
cellSpacing="0" cellPadding="0" Width="100%" bgColor="#ffffff"
border="0">
<tr>
<td width="20%" colSpan="3" style="height: 14px"></td>
</tr>
<tr>
<td vAlign="top" align="center" width="95%">
<asp:loginview runat="server"
id="LoginView1"><LoggedInTemplate>
<!-- BEGIN CONTENT AREA -->
<TABLE id="Table9" height=25
cellSpacing=0 cellPadding=0 width="75%" border=0
background="images/pageTitleTile25.gif">
<TBODY>
<TR>
<TD
align=left><uc1:pagehistory id="PageHistory" runat="server"
Initialize="True" Visible="True" Text="Main"></uc1:pagehistory</TD>

Removing the "center" align from the td tag above just left alignes the
cell. The content is still centered. Even tho the TD tag for the
pagehistory control is left justified, the pagehistory control is
centered when rendered.

css for "arrowBackround"

.arrowBackground {
background-image: url(images/backgroundArrow.gif);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center bottom;

}I'm at a loss.

Jason

On Jan 26, 3:02 pm, senfo <enceladus...@yahoo.comI-WANT-NO-SPAMwrote:
TheLongshot wrote:
I just recently converted a few pages of my application to using master
pages. Problem is, in all of my content pages, the contents are
centered. I can't figure out why. The markup in the content page
seems to ignore any attempts to manually align right. So what's the
deal?Unfortunately, it's impossible to give you a detailed response without
seeing your code and/or markup. Your best bet is to look at the
rendered HTML or the CSS for your page(s). More than likely you have
something in there that you're not expecting.
At any rate, it's most likely not related to master pages, per se.
Hope that helps,
--
Sean
website:http://senfo.blogspot.com
Jan 29 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sasha | last post by:
Hi all asp.net proffesionals out there, How do you implement master pages in your applications? What libraries do you use and what have been your experience? Sasha
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
1
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
7
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
8
by: JT | last post by:
Hi, I have done a fair amount of style editing inline in ASP. I'm now using VS 2005 with a standard web project (not Web Application Project). This is my first foray into CSS in a style sheet...
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.