Page layouts in ASP.NET

Discussion in 'ASP .Net' started by Angus SC2, Nov 17, 2004.

  1. Angus SC2

    Angus SC2 Guest

    Hi, I am writing a little web-app in Visual Studio.NET using C# and ASP.net.

    I have a few questions about page layouts. ..

    What I am trying to achieve is to have every page in my app like the
    following: It will be a table that fills the entire browser window and has a
    header at the top, a navbar on the left, a footer at the bottom and the body
    section on the right.

    I am wondering how to fit this into the visual studio thing where you design
    each page in the designer? Really what I want is for the designed page to
    be squeezed into the body section on the above layout.

    If I have to abandon using the page designer altogether, and just generate
    the HTML myself, that will be OK but it would be better if I can still use
    it to design each page as we want it, and then have that inserted into our
    body section.

    If I have to hardcode it without the page designer then what should I be
    using to include the html and aspx files? I've tried stuff like:

    <TABLE cellSpacing="1" cellPadding="1" width="300" border="1" height="32">
    <TR>
    <TD><!--#Include File="TestHeader.htm"--></TD>
    </TR>
    <TR>
    <TD><!--#Include File="Deals.aspx"--></TD>
    </TR>
    <TR>
    <TD><!--#Include File="TestFooter.htm"--></TD>
    </TR>
    </TABLE>

    in an aspx file just to try get a header/body/footer layout going but the
    deals.aspx file output just goes straight over the top of the table (and the
    TestHeader.htm and TestFooter.htm output).

    Any advice?

    Thank you in advance
    Angus
     
    Angus SC2, Nov 17, 2004
    #1
    1. Advertising

  2. Angus SC2

    Angus SC2 Guest

    "Angus SC2" <> wrote in message news:...
    > Hi, I am writing a little web-app in Visual Studio.NET using C# and
    > ASP.net.
    >
    > I have a few questions about page layouts. ..
    >


    If possible I would like to be able to generate html in a string object in
    the form handler and squirt it into some part of the page

    Thanks
    Angus
     
    Angus SC2, Nov 17, 2004
    #2
    1. Advertising

  3. Angus SC2

    MattC Guest

    Create a header and footer user control (.ascx) and place these at the top
    and bottom of every page you create with the designer. If you are using
    Whidbey then you can creat a master page with the required layout and
    inherit from that to create individual pages with the content you require.

    MattC

    "Angus SC2" <> wrote in message news:...
    > Hi, I am writing a little web-app in Visual Studio.NET using C# and

    ASP.net.
    >
    > I have a few questions about page layouts. ..
    >
    > What I am trying to achieve is to have every page in my app like the
    > following: It will be a table that fills the entire browser window and has

    a
    > header at the top, a navbar on the left, a footer at the bottom and the

    body
    > section on the right.
    >
    > I am wondering how to fit this into the visual studio thing where you

    design
    > each page in the designer? Really what I want is for the designed page to
    > be squeezed into the body section on the above layout.
    >
    > If I have to abandon using the page designer altogether, and just generate
    > the HTML myself, that will be OK but it would be better if I can still use
    > it to design each page as we want it, and then have that inserted into our
    > body section.
    >
    > If I have to hardcode it without the page designer then what should I be
    > using to include the html and aspx files? I've tried stuff like:
    >
    > <TABLE cellSpacing="1" cellPadding="1" width="300" border="1" height="32">
    > <TR>
    > <TD><!--#Include File="TestHeader.htm"--></TD>
    > </TR>
    > <TR>
    > <TD><!--#Include File="Deals.aspx"--></TD>
    > </TR>
    > <TR>
    > <TD><!--#Include File="TestFooter.htm"--></TD>
    > </TR>
    > </TABLE>
    >
    > in an aspx file just to try get a header/body/footer layout going but the
    > deals.aspx file output just goes straight over the top of the table (and

    the
    > TestHeader.htm and TestFooter.htm output).
    >
    > Any advice?
    >
    > Thank you in advance
    > Angus
    >
    >
     
    MattC, Nov 17, 2004
    #3
  4. Angus SC2

    John M Deal Guest

    For this particular issue you could put a PlaceHolder on the page and
    then in your code behind create your html, put it in a literal control,
    and add the literal control to the placeholder's controls collection.
    That would "squirt" it into place. (that makes two questions today that
    this will solve)

    However for your original question you should take a look at Paul
    Wilson's Master Pages article here:

    http://authors.aspalliance.com/PaulWilson/Articles/?id=14

    It is a really smooth framework that does a great job with allowing you
    to create template pages without rebuilding the static "C" clamp parts
    of the page. Hope it helps.

    Have A Better One!

    John M Deal, MCP
    Necessity Software

    Angus SC2 wrote:
    > "Angus SC2" <> wrote in message news:...
    >
    >>Hi, I am writing a little web-app in Visual Studio.NET using C# and
    >>ASP.net.
    >>
    >>I have a few questions about page layouts. ..
    >>

    >
    >
    > If possible I would like to be able to generate html in a string object in
    > the form handler and squirt it into some part of the page
    >
    > Thanks
    > Angus
    >
    >
     
    John M Deal, Nov 17, 2004
    #4
    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. Deasun O'Donnachadha

    Browser Freindly Page Layouts

    Deasun O'Donnachadha, Jul 21, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    351
    Deasun O'Donnachadha
    Jul 21, 2003
  2. Knoxy
    Replies:
    1
    Views:
    343
    Mark Rae
    Jun 30, 2006
  3. Michael

    Page layouts in mod_python?

    Michael, Dec 19, 2006, in forum: Python
    Replies:
    3
    Views:
    339
    Bruno Desthuilliers
    Dec 20, 2006
  4. Replies:
    0
    Views:
    420
  5. Ramon F Herrera

    Swing layouts vs. SWT layouts?

    Ramon F Herrera, Nov 10, 2007, in forum: Java
    Replies:
    5
    Views:
    2,742
    Benjamin Toren
    Dec 7, 2009
Loading...

Share This Page