473,382 Members | 1,809 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,382 software developers and data experts.

Master pages - organising layout - contentplaceholder confusion

Ok

Im a bit confused with contentplace holders?!!

Should i use div all the time within them?

--
--------------------------------- --- -- -
Posted with NewsLeecher v3.5 Beta 10
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

Jun 1 '06 #1
5 1621
Quick answer is yes, we use divs all the time withing the MasterPage as well
as the content pagesThe content template is actually only used at design
time and is not actually compiled as such -- only its contents -- which is
why they are called "place holders."

You can start getting deeper insight by keeping trace enabled in a page
while designing and building. Read the control tree and look for your
controls. You'll observe controls prefixed with ctl0 and so on which again
are place holding identifiers to allow the compiler to manage the control
tree hierarchy.

You are going to have to really understand this when you start trying to
reference controls and their properties. At first it can be very confusing
when a control is a child of a child of a child of a parent control which
can be very common when working with templated controls.
Templating becomes a neccessity when one realizes the canned login controls
and other canned controls in 2.0 are often insufficient for real world
applications and have to be taken apart and rebuilt using templates which
contain our own HTML and CSS.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"kd" <kd****@spam.com> wrote in message
news:44**********************@news.usenetmonster.c om...
Ok

Im a bit confused with contentplace holders?!!

Should i use div all the time within them?

--
--------------------------------- --- -- -
Posted with NewsLeecher v3.5 Beta 10
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

Jun 2 '06 #2
The div is a great container control, but you are not limited to a <DIV> to
organize content within a placeholder. It is really your decision. The div
makes it easy to add styles to a complete section, however, so it is a nice
way to encapsulate a particular area.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"kd" <kd****@spam.com> wrote in message
news:44**********************@news.usenetmonster.c om...
Ok

Im a bit confused with contentplace holders?!!

Should i use div all the time within them?

--
--------------------------------- --- -- -
Posted with NewsLeecher v3.5 Beta 10
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

Jun 2 '06 #3
Thanks!

What else can i use besides DIV?


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.5 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

Jun 2 '06 #4
The master page has content holders <asp:ContentHolder>. The page itself has
<asp:Content>. What you decide to put in the content tags is your own
decision. I have seen people put tables directly or even use Panels, which
render as <SPAN> tags. This example, amitedly older, uses a table:
http://msdn2.microsoft.com/en-us/library/zhhddkxy.aspx

Admitedly an older article, but it should still work.

The DIV, to me, is the most useful if you are using CSS, which you should be
as it allows you to change things without major editing. If you want to
organize with tables, instead, it is an option, but it locks up your display
and forces a complete redesign to change things. If you want to see the
value of DIVs with CSS, check out:
http://www.csszengarden.com/

Look at the HTML and CSS file separately and you will see the entire layout
is done with CSS. The downside is you may end up with a mixed bag, as your
master page is probably built with tables and your content with CSS, which
can be confusing. :-)

I generally design my sites with PhotoShop (or another graphics program -
Expression Graphic Designer, in beta, is free for now; Paint.NET is also
free, but has fewer options and is difficult for me as a design tool.) I
then lay out a complete page, including common elements, using CSS (static
version). I then apply the common elements to a master page (DWT in non
ASP.NET 2.0 sites) and the rest to content areas. It works rather nicely.

You have to decide how much time you wish to invest in learning these
skills.

Short story: Put what you want in the content tag, but the DIV is a good
container object, esp. if you use CSS.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"kd" <kd****@spam.com> wrote in message
news:44***********************@news.usenetmonster. com...
Thanks!

What else can i use besides DIV?


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.5 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

Jun 2 '06 #5
I'd say the "short story" explains what -- not to -- put into a
ContentPlaeHolder and that would be anything except the head, body or form
elements. Just think of content pages as if they were #included as the same
principles apply.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:ur**************@TK2MSFTNGP04.phx.gbl...
The master page has content holders <asp:ContentHolder>. The page itself
has <asp:Content>. What you decide to put in the content tags is your own
decision. I have seen people put tables directly or even use Panels, which
render as <SPAN> tags. This example, amitedly older, uses a table:
http://msdn2.microsoft.com/en-us/library/zhhddkxy.aspx

Admitedly an older article, but it should still work.

The DIV, to me, is the most useful if you are using CSS, which you should
be as it allows you to change things without major editing. If you want to
organize with tables, instead, it is an option, but it locks up your
display and forces a complete redesign to change things. If you want to
see the value of DIVs with CSS, check out:
http://www.csszengarden.com/

Look at the HTML and CSS file separately and you will see the entire
layout is done with CSS. The downside is you may end up with a mixed bag,
as your master page is probably built with tables and your content with
CSS, which can be confusing. :-)

I generally design my sites with PhotoShop (or another graphics program -
Expression Graphic Designer, in beta, is free for now; Paint.NET is also
free, but has fewer options and is difficult for me as a design tool.) I
then lay out a complete page, including common elements, using CSS (static
version). I then apply the common elements to a master page (DWT in non
ASP.NET 2.0 sites) and the rest to content areas. It works rather nicely.

You have to decide how much time you wish to invest in learning these
skills.

Short story: Put what you want in the content tag, but the DIV is a good
container object, esp. if you use CSS.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"kd" <kd****@spam.com> wrote in message
news:44***********************@news.usenetmonster. com...
Thanks!

What else can i use besides DIV?


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.5 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -


Jun 2 '06 #6

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

Similar topics

9
by: Andrew Kidd | last post by:
Hi, I've just been working through several examples of how to create Master pages and then create content pages which are linked, but I cannot see the Master page when I'm viewing the content...
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...
4
by: D | last post by:
Hi, I've been toying around with master pages and am trying to set up your standard banner across the top and 3 areas below that, left content, center content and right content. I have the...
4
by: Jeff Allan | last post by:
Hello, I am starting to use Master pages. I understand the concept that these pages should remain passive. So, I need a little assistance. Scenario: 1. Master page with a search box &...
3
by: Ronald S. Cook | last post by:
For my web pages that have an associated master page, when I try to work with them in design mode, I get this "gray film" over it and I can edit only the master. How can I get to my page in...
4
by: Rob | last post by:
Hi, I have a master page that contains a table layout. The contentplaceholder is located in one of the table cells. With frames technology it was possible for hyperlinks to load the linked pages...
5
by: =?Utf-8?B?QW50?= | last post by:
Hi, I'm a newbie to the Master page. When i drag an image directly onto the master page from say my image folder, it is reflected in all pages which use it, however, if I drag a table, layout,...
5
by: Murray | last post by:
Forgive me if this question is too basic, but I'm new to ASP.NET programming, and I can't locate a simple answer to this question. I have a web page that consists of a Master Page and a single...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.