Page layouts in ASP.NET

A

Angus SC2

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
 
A

Angus SC2

Angus SC2 said:
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
 
M

MattC

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
 
J

John M Deal

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top