Layout basics

S

Samuel Shulman

I am looking for good guidance for positioning controls on the
form.document, it is absolute nightmare and I don't know where to begin

Thank you,
Samuel Shulman
 
K

Kevin Spencer

Hi Samuel,

As an admitted newbie, I can certainly see why you would call the
positioning issue an "absolute nightmare." In fact, it is a nightmare for
many of us, and no piece of cake to those of us with quite a bit of
experience. And I wish I had some simple rules for you to follow. But there
are none. I'm going to start from the beginning, and please forgive me if I
tell you anything you already know.

ASP.Net is a technology for developing web applications. A web application
is an application in which the vast majority of the programming is on a
server machine, but the user interface is presented via a "thin-client" HTML
browser user interface.

I'm sure you've visited many web sites, and viewed many web pages, even as
an end-user. What I'm not sure about is if you're at all familiar with HTML
(HyperText Markup Language), which is the text-based language that provides
the display in a browser. HTML started out as an invention of the Mosaic
group, who created the first web browsers, and a language for formatting
display in those browsers. It quickly caught on, and before you know it,
there were several popular web browsers, and several different "flavors" of
HTML floating around. Things began to get complicated. There were no
standards, and the major players in the game were all trying to outdo each
other with browsers that did more, which meant creating HTML that enabled
browsers to do more. Thus began the infamous "browser wars" not so long ago,
in a galaxy not so far away.

Thankfully, standards organizations like the W3C (World-Wide Web Consortium)
and ISO (International Organization for Standards) began to get involved, to
bring some order to the chaos, and make life simpler for everyone. And that
goal is being realized, but is not yet fully realized. So, between "legacy"
HTML, and the various flavors of browsers, perhaps most notably IE 6, which
has long outlived its heyday, soon to be replaced by the standards-based
IE7, which has been delayed for entirely too long, we have an "absolute
nightmare" involved in doing layout that looks more or less the same in the
major browsers.

HTML started off rather simply, with not much thought in the way of fancy
layout, and the use of an ever-expanding list of inline attributes to handle
layout properties. In the beginning, HTML was laid out in a "flow layout" in
which various elements simply appeared in the browser in the order in which
they existed in the markup language, some on new lines, and some inline.
This was an increasingly troublesome situation. The first solution was the
use of HTML tables to provide enhanced layout capabilities. But this was
only a partial solution, and not extremely well-thought-out. Tables still
used inline markup and were limited to a tabular format.

The advent of CSS (Cascading Style Sheets) changed all that. CSS could be
written as inline style attributes, or in a single block in the head of an
HTML document, or even as an external document that was linked to HTML
elements via style names, element names, and id attributes. CSS was not
limited to a tabular format; in fact, elements could be freely positioned in
any variety of ways. Now CSS is the dominant layout methodology. But CSS is
more complex than tables. CSS elements can be positioned absolutely
(relative to the page) or relatively to other elements.

Getting back to ASP.Net now, ASP.Net was an evolution in web application
development, which started with CGI, ASP, and other similar technologies.
Microsoft decided that ASP should behave in a familiar way, and thus
introduced the concept of the "WebForm," which is intended to behave much
like a Windows Form, both to the developer and to the user. Of course, it
can't really, but it does a decent job of approximating much of the look and
feel.

Because Windows Forms use "absolute positioning" in a Form interface, the
default layout "style" of a WebForm is called "grid layout." This uses CSS
absolute positioning. However, because a browser with HTML is not a Windows
Form application, and browsers are all different, well, it is only partially
successful. WebControls and HtmlControls are actually server-side classes
that present themselves as HTML elements or combinations thereof on the
client browser.

Bottom line is, there are 2 basic paths you can take, and each has its
plusses and minuses. You can use "flow layout" and HTML tables, which is
simpler, but less flexible and extensible, or you can use "grid layout" and
absolute positioning. Or, you can mix and match. But in any case, you're
going to have to learn a good bit more about HTML, JavaScript and CSS to get
any good at it. And test in a variety of browsers, screen resolutions, etc.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.
 
R

Ray Booysen

Hi Kevin

Nice reply! :)
Thanks!

Kevin said:
Hi Samuel,

As an admitted newbie, I can certainly see why you would call the
positioning issue an "absolute nightmare." In fact, it is a nightmare for
many of us, and no piece of cake to those of us with quite a bit of
experience. And I wish I had some simple rules for you to follow. But there
are none. I'm going to start from the beginning, and please forgive me if I
tell you anything you already know.

ASP.Net is a technology for developing web applications. A web application
is an application in which the vast majority of the programming is on a
server machine, but the user interface is presented via a "thin-client" HTML
browser user interface.

I'm sure you've visited many web sites, and viewed many web pages, even as
an end-user. What I'm not sure about is if you're at all familiar with HTML
(HyperText Markup Language), which is the text-based language that provides
the display in a browser. HTML started out as an invention of the Mosaic
group, who created the first web browsers, and a language for formatting
display in those browsers. It quickly caught on, and before you know it,
there were several popular web browsers, and several different "flavors" of
HTML floating around. Things began to get complicated. There were no
standards, and the major players in the game were all trying to outdo each
other with browsers that did more, which meant creating HTML that enabled
browsers to do more. Thus began the infamous "browser wars" not so long ago,
in a galaxy not so far away.

Thankfully, standards organizations like the W3C (World-Wide Web Consortium)
and ISO (International Organization for Standards) began to get involved, to
bring some order to the chaos, and make life simpler for everyone. And that
goal is being realized, but is not yet fully realized. So, between "legacy"
HTML, and the various flavors of browsers, perhaps most notably IE 6, which
has long outlived its heyday, soon to be replaced by the standards-based
IE7, which has been delayed for entirely too long, we have an "absolute
nightmare" involved in doing layout that looks more or less the same in the
major browsers.

HTML started off rather simply, with not much thought in the way of fancy
layout, and the use of an ever-expanding list of inline attributes to handle
layout properties. In the beginning, HTML was laid out in a "flow layout" in
which various elements simply appeared in the browser in the order in which
they existed in the markup language, some on new lines, and some inline.
This was an increasingly troublesome situation. The first solution was the
use of HTML tables to provide enhanced layout capabilities. But this was
only a partial solution, and not extremely well-thought-out. Tables still
used inline markup and were limited to a tabular format.

The advent of CSS (Cascading Style Sheets) changed all that. CSS could be
written as inline style attributes, or in a single block in the head of an
HTML document, or even as an external document that was linked to HTML
elements via style names, element names, and id attributes. CSS was not
limited to a tabular format; in fact, elements could be freely positioned in
any variety of ways. Now CSS is the dominant layout methodology. But CSS is
more complex than tables. CSS elements can be positioned absolutely
(relative to the page) or relatively to other elements.

Getting back to ASP.Net now, ASP.Net was an evolution in web application
development, which started with CGI, ASP, and other similar technologies.
Microsoft decided that ASP should behave in a familiar way, and thus
introduced the concept of the "WebForm," which is intended to behave much
like a Windows Form, both to the developer and to the user. Of course, it
can't really, but it does a decent job of approximating much of the look and
feel.

Because Windows Forms use "absolute positioning" in a Form interface, the
default layout "style" of a WebForm is called "grid layout." This uses CSS
absolute positioning. However, because a browser with HTML is not a Windows
Form application, and browsers are all different, well, it is only partially
successful. WebControls and HtmlControls are actually server-side classes
that present themselves as HTML elements or combinations thereof on the
client browser.

Bottom line is, there are 2 basic paths you can take, and each has its
plusses and minuses. You can use "flow layout" and HTML tables, which is
simpler, but less flexible and extensible, or you can use "grid layout" and
absolute positioning. Or, you can mix and match. But in any case, you're
going to have to learn a good bit more about HTML, JavaScript and CSS to get
any good at it. And test in a variety of browsers, screen resolutions, etc.
 
S

Samuel Shulman

Thank you for your time

Samuel

Kevin Spencer said:
Hi Samuel,

As an admitted newbie, I can certainly see why you would call the
positioning issue an "absolute nightmare." In fact, it is a nightmare for
many of us, and no piece of cake to those of us with quite a bit of
experience. And I wish I had some simple rules for you to follow. But
there are none. I'm going to start from the beginning, and please forgive
me if I tell you anything you already know.

ASP.Net is a technology for developing web applications. A web application
is an application in which the vast majority of the programming is on a
server machine, but the user interface is presented via a "thin-client"
HTML browser user interface.

I'm sure you've visited many web sites, and viewed many web pages, even as
an end-user. What I'm not sure about is if you're at all familiar with
HTML (HyperText Markup Language), which is the text-based language that
provides the display in a browser. HTML started out as an invention of the
Mosaic group, who created the first web browsers, and a language for
formatting display in those browsers. It quickly caught on, and before you
know it, there were several popular web browsers, and several different
"flavors" of HTML floating around. Things began to get complicated. There
were no standards, and the major players in the game were all trying to
outdo each other with browsers that did more, which meant creating HTML
that enabled browsers to do more. Thus began the infamous "browser wars"
not so long ago, in a galaxy not so far away.

Thankfully, standards organizations like the W3C (World-Wide Web
Consortium) and ISO (International Organization for Standards) began to
get involved, to bring some order to the chaos, and make life simpler for
everyone. And that goal is being realized, but is not yet fully realized.
So, between "legacy" HTML, and the various flavors of browsers, perhaps
most notably IE 6, which has long outlived its heyday, soon to be replaced
by the standards-based IE7, which has been delayed for entirely too long,
we have an "absolute nightmare" involved in doing layout that looks more
or less the same in the major browsers.

HTML started off rather simply, with not much thought in the way of fancy
layout, and the use of an ever-expanding list of inline attributes to
handle layout properties. In the beginning, HTML was laid out in a "flow
layout" in which various elements simply appeared in the browser in the
order in which they existed in the markup language, some on new lines, and
some inline. This was an increasingly troublesome situation. The first
solution was the use of HTML tables to provide enhanced layout
capabilities. But this was only a partial solution, and not extremely
well-thought-out. Tables still used inline markup and were limited to a
tabular format.

The advent of CSS (Cascading Style Sheets) changed all that. CSS could be
written as inline style attributes, or in a single block in the head of an
HTML document, or even as an external document that was linked to HTML
elements via style names, element names, and id attributes. CSS was not
limited to a tabular format; in fact, elements could be freely positioned
in any variety of ways. Now CSS is the dominant layout methodology. But
CSS is more complex than tables. CSS elements can be positioned absolutely
(relative to the page) or relatively to other elements.

Getting back to ASP.Net now, ASP.Net was an evolution in web application
development, which started with CGI, ASP, and other similar technologies.
Microsoft decided that ASP should behave in a familiar way, and thus
introduced the concept of the "WebForm," which is intended to behave much
like a Windows Form, both to the developer and to the user. Of course, it
can't really, but it does a decent job of approximating much of the look
and feel.

Because Windows Forms use "absolute positioning" in a Form interface, the
default layout "style" of a WebForm is called "grid layout." This uses CSS
absolute positioning. However, because a browser with HTML is not a
Windows Form application, and browsers are all different, well, it is only
partially successful. WebControls and HtmlControls are actually
server-side classes that present themselves as HTML elements or
combinations thereof on the client browser.

Bottom line is, there are 2 basic paths you can take, and each has its
plusses and minuses. You can use "flow layout" and HTML tables, which is
simpler, but less flexible and extensible, or you can use "grid layout"
and absolute positioning. Or, you can mix and match. But in any case,
you're going to have to learn a good bit more about HTML, JavaScript and
CSS to get any good at it. And test in a variety of browsers, screen
resolutions, etc.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top