473,395 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Centering a MasterPage in a browswer window using Visual Web Developer 2005

I would like to have it so that my webpages, which are built using
MasterPages, always appear in the center of the browser of the user, even if
he resizes the browser window. As a starting point, when creating the
Masterpage, this is the generated html:
<body>

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

<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</body>

How do I modify it so that if I use a table that has a border for the site,
the table always is centered in the browser window?

TIA
Dec 2 '05 #1
4 1584
Cascading Style Sheets

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/


"Paolo" <Pa************@TheCornerStore.com> wrote in message
news:h4*******************@fe12.lga...
I would like to have it so that my webpages, which are built using
MasterPages, always appear in the center of the browser of the user, even
if he resizes the browser window. As a starting point, when creating the
Masterpage, this is the generated html:
<body>

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

<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</body>

How do I modify it so that if I use a table that has a border for the
site, the table always is centered in the browser window?

TIA

Dec 2 '05 #2
I haven't tried this, but couldn't you..

<center>
<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div> </center>

or
<div align="center">

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

I realize "<center>" is no longer supported, but isn't it still a viable
solution.

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl... Cascading Style Sheets

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/


"Paolo" <Pa************@TheCornerStore.com> wrote in message
news:h4*******************@fe12.lga...
I would like to have it so that my webpages, which are built using
MasterPages, always appear in the center of the browser of the user, even
if he resizes the browser window. As a starting point, when creating the
Masterpage, this is the generated html:
<body>

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

<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</body>

How do I modify it so that if I use a table that has a border for the
site, the table always is centered in the browser window?

TIA


Dec 2 '05 #3
If you like looking at red squiggles underlining all of the deprecated
attributes and getting XHTML warning Tooltips while your in the Visual
Studio IDE by all means use deprecated attributes.

I think its better to use CSS -- as well as tables where pragmatic -- but
learning to use what and where when developing ASP.NET is just another
learning curve.

Max Design offers a number of sample CSS layouts [1]. I integrate HTML
tables into CSS layouts as needed.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://www.maxdesign.com.au/presenta...outs/index.cfm


"AMDRIT" <am****@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
I haven't tried this, but couldn't you..

<center>
<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div> </center>

or
<div align="center">

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>


I realize "<center>" is no longer supported, but isn't it still a viable
solution.

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl...
Cascading Style Sheets

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/


"Paolo" <Pa************@TheCornerStore.com> wrote in message
news:h4*******************@fe12.lga...
I would like to have it so that my webpages, which are built using
MasterPages, always appear in the center of the browser of the user, even
if he resizes the browser window. As a starting point, when creating
the Masterpage, this is the generated html:
<body>

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

<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</body>

How do I modify it so that if I use a table that has a border for the
site, the table always is centered in the browser window?

TIA



Dec 3 '05 #4
Paolo,

I assume you mean horizontal centering, vertical is in opinion almost
impossible.

There is on Internet javascript that can measure the sides (be aware that
you need two versions of browser types for that, for IE is often another one
needed than for Netscape derived ones).

In my opinion is a better way not to use the pixel as measuring however to
do everything in % in CSS or whatever.

I hope this helps,

Cor

"Paolo" <Pa************@TheCornerStore.com> schreef in bericht
news:h4*******************@fe12.lga...
I would like to have it so that my webpages, which are built using
MasterPages, always appear in the center of the browser of the user, even
if he resizes the browser window. As a starting point, when creating the
Masterpage, this is the generated html:
<body>

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

<div>

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

</div>

</form>

</body>

How do I modify it so that if I use a table that has a border for the
site, the table always is centered in the browser window?

TIA

Dec 3 '05 #5

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

Similar topics

15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
5
by: Brandon Potter | last post by:
Forgive me if this has already been covered... I use dual displays and have 2 - 3 Visual Studio .NET 2003's open at the same time, however, without fail, at some point during my session, the...
4
by: Ali | last post by:
i am using visual studio 2005 and I am trying to create a popup calender so when a user click on a image on the main form, a calender will then popup, the user will select a date and the date will...
0
by: ME | last post by:
I can't seem to delete records using an objectdatasource. The object is a Typed Collection built by Visual Studio that access a SQL Database. When I try to delete using the ObjectDataSource it...
3
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
3
by: Tom | last post by:
I have a VS.NET 2005 WEB application where I place all of my common controls (ie header, nav, footer) into a mater page template. Then all of my web forms inherit from the mater page template. All...
7
by: Bon | last post by:
Dear all I create a master page with image buttons on the left-hand side for navigation. When a user clicks the student button, the content (i.e. ContentPlaceholder) in masterpage will be...
2
by: Frank Milverckowitz | last post by:
Hi, New to .NET... question about Masterpages vs. using Frameset I'm using Visual Studio 2005 and notice that the generated pages are of DTD/Doctype that don't support framesets. To use...
2
by: kurt sune | last post by:
Hello, I have a weird problem, I hope someone can explain this for me. I have a webpage using masterpage. In it I create a popup window using this code: Dim js As String = "<script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.