Page layout in VS 2005?


David Veeneman

I'm just getting started with ASP.NET in Visual Studio 2005. The last web
work I did involved ASP 3.0 in FrontPage.

I've been through the MSDN tutorials on creating web pages, but not of them
seem to cover real-world page layout. In the ASP era, I used tables to
provide a structure for a page, then coded HTML controls within the grid.

So, my first question is: Are pages laid out the same way in ASP.NET--start
with a table and add controls?

I tried using the ASP.NET Table control like a TableLayoutPanel in Windows
Forms, but the table doesn't accept control drops. That leads me to believe
VS 2005 must have a better way of structuring a page.

BTW, I'm familiar with Master Pages, and I plan to use them as soon as I get
proficient at laying out basic web pages in VS 2005.

That brings me to my second question: Are there any good tutorials out there
on web page layout procedures using VS 2005? I've done a Google search, but
I don't see anything that looks like it walks through real world examples.
I'm not concerned about design at this point; I just want to get a page laid

Thanks in advance.


Remember that Web browsers haven't changed much in the past few years...
they are for the most part expecting plain old HTML. Using VS.NET to create
that HTML doesn't change anything from the browser's point of view. The
browser doesn't know or care about how the HTML was created (VS.NET,
FrontPage, etc). So, you basically have two ways to do page layout: table
layout and CSS-P.... just like if you were doing everything manually, with
Dreamweaver, FrontPage, or whatever. VS.NET doesn't change that fact. It
might write crappy table layouts for you... but at the end of the day it's
still plain old HTML with table layouts and/or CSS. My suggestion is to
stick with Dreamweaver or FrontPage (or even Notepad) for HTML-specific
work; and VS.NET for all code-behind programming work.


Bruce Barker

table layout is still the best. vs2005 went from vs2003's failed grid mode
drag and and drop (trying to look vb forms) to good support for html editing
in the html window (not design). a future product will give a more visual

-- bruce (

David Veeneman

Thanks-- That's what I was looking for. It sounds like the best approach is
to drag out a table andcontrols in design view, then move controls into the
table in the HTML view. Have I got it right?

David Veeneman

Now this is making more sense! For the benefit of anyone else researching
this issue, here is why the table control wouldn't accept controls dropped
on it: ASP.NET has *two* table controls; a server-side table (in the
Standard section of the VS 2005 Toolbox), and an HTML table (in the HTML
section of the Toolbox). I was dragging the server-side table onto a grid
and trying to drop controls on that. Use the HTML table, and you can drop
controls on it just fine.

Better yet, in Design View, select Insert Table from the Layout menu. It
brings up a dialog where an HTML table can be configured. Select 'Template'
at the top of the dialog, and you get a drop-down list of page-layout
tables. The rest of the Layout menu has a number of options for configuring
and formatting layout tables.

David Veeneman

Let me answer my own question: That's not quite it. Tables can be laid out
in Design view, and the Layout menu has a number of options to assist with
this task. See my answer to my original question. If you are having trouble
dropping controls on a table, make sure you are using an HTML table, not a
server-side table.

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