By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,275 Members | 1,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,275 IT Pros & Developers. It's quick & easy.

masterpages vs. CSS or Masterpages with CSS??? help me out please!

P: n/a
Dear All

In Classic ASP I used CSS for ALL layout.
Now in ASP.NET version 2 I am testing out Masterpages as they come in very
handy.

It seems like it is replacing CSS for layout but what is the best choise?

1) Using Masterpages with Themes (css / images / skins included in this
theme)
2) Using only CSS (because I see at this moment no advantage of masterpages
against css)
3) Using Masterpages only

Please help me out, I am an expierend ASP classic writer, but I am using
ASP.NET for the first week and I am still confused

Thanks in advance...

Nick Wouters
May 8 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I don't see that Masterpages/CSS have any overlap - the former are
chunks of content that you want on each page with space left for page
specific content. I use MasterPages to set up my basic page structure,
insert content with a contentholder, and style everything with CSS.

May 8 '06 #2

P: n/a
With CSS you can also make parts with <DIV></DIV>

You are probebly right, maybe you do not understand my confusion?

Thanks

Nick

"Flinky Wisty Pomm" <Pa********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
I don't see that Masterpages/CSS have any overlap - the former are
chunks of content that you want on each page with space left for page
specific content. I use MasterPages to set up my basic page structure,
insert content with a contentholder, and style everything with CSS.

May 8 '06 #3

P: n/a
You can't make parts with CSS... You can style them.

You could have a MasterPage containing

<div id="mainBody>
<asp:ContentHolder id="stuff" runat="server" />
</div>

<div id="leftMenu">
<asp:Repeater id="leftMenuLinks">
... unordered list of links here ..
</asp:Repeater>
</div>

That'll give you a plain ol' HTML document, your menu links are on the
master page so they can appear on each page which uses that master, as
is your main content DIV.

You can layout/style that with CSS just as you would an ASP classic
page. What am I missing?

May 8 '06 #4

P: n/a
In Classic ASP you would also do like this

<DIV id="mainBody">
bla bla bla
</DIV>

and the menu

<DIV ID="leftmenu">
<a href="link1.asp">link1</a>
<a href="link2.asp">link2</a>
</DIV>

and in your CSS file you say that the menu is at the left (margin : 0) and
the mainbody has margin 200px for example
Each new page you make a new DIV with the same ID="leftmenu" and
ID="mainBody"
It is just a few lines more code but I am working withouth masterpages then,
can you tell me the Main advantages of Masterpages please
because I don't see any BIG advantage at this time.

Sorry to trouble you with this strange question...

Thanks in advance

Nick

"Flinky Wisty Pomm" <Pa********@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
You can't make parts with CSS... You can style them.

You could have a MasterPage containing

<div id="mainBody>
<asp:ContentHolder id="stuff" runat="server" />
</div>

<div id="leftMenu">
<asp:Repeater id="leftMenuLinks">
... unordered list of links here ..
</asp:Repeater>
</div>

That'll give you a plain ol' HTML document, your menu links are on the
master page so they can appear on each page which uses that master, as
is your main content DIV.

You can layout/style that with CSS just as you would an ASP classic
page. What am I missing?

May 8 '06 #5

P: n/a
In classic asp, it's common to put headers/footers etc into include
files and to stick those at the top of your pages so that you can have
the common HTML in a single place.

MasterPages allow you to keep the common structural code for your pages
in one place. Think of them as templates, if you need to change that
structural code there is only one place to do it. You can handle events
for UI navigation and things inside your MasterPage so that you don't
need to duplicate that either. It's just good practice, keep common
code in a single place and it's easier to manage.

May 8 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.