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

Discussion in 'ASP .Net' started by Nick Wouters, May 8, 2006.

  1. Nick Wouters

    Nick Wouters Guest

    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
    Nick Wouters, May 8, 2006
    #1
    1. Advertising

  2. 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.
    Flinky Wisty Pomm, May 8, 2006
    #2
    1. Advertising

  3. Nick Wouters

    Nick Wouters Guest

    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" <> wrote in message
    news:...
    >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.
    >
    Nick Wouters, May 8, 2006
    #3
  4. 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?
    Flinky Wisty Pomm, May 8, 2006
    #4
  5. Nick Wouters

    Nick Wouters Guest

    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" <> wrote in message
    news:...
    > 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?
    >
    Nick Wouters, May 8, 2006
    #5
  6. 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.
    Flinky Wisty Pomm, May 8, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. suzy
    Replies:
    3
    Views:
    3,092
  2. KK
    Replies:
    2
    Views:
    556
    Big Brian
    Oct 14, 2003
  3. farseer

    CSS and Masterpages

    farseer, Aug 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,568
    Erik Funkenbusch
    Aug 7, 2006
  4. =?Utf-8?B?TWFya0F1cml0?=

    Masterpages css problems

    =?Utf-8?B?TWFya0F1cml0?=, Oct 26, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    284
    apathetic
    Oct 26, 2006
  5. JohnE

    masterpages with masterpages

    JohnE, Dec 7, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    487
    Hillbilly
    Dec 8, 2009
Loading...

Share This Page