tags:

views:

93

answers:

2

I am developing a new web application, but just found out I am required to use ASP.NET 2.0. Because things were so different back when ASP.NET 2.0 was released, I am finding it hard to determine what method of positioning I should use for the web forms.

The web app has 8 or 9 screens, all of which ask a series of questions (average of 10 questions per page, roughly). The end result I want is simply a nice functional layout of controls on each page. I'd be quite happy to simply drag the controls where I want them using the Visual Studio designer.

However, back when ASP.NET 2.0 was the latest version, there was strong advice everywhere saying, "Do not use 'Absolute Layout'. You will have big problems if the end user has a different screen resolution than you do." The recommendation at the time was to use "flow layout", by which ASP.NET and/or the browser would layout the controls for you.

But the industry has changed significantly since then. Now, the preferred method for positioning items is to use CSS absolute positioning. I know ASP.NET MVC makes this possible.

But the situation is very murky to me because I have to go back and use such an old version of ASP.NET.

So can anyone please advise me: for a web app written in 2009, using ASP.NET 2.0, that will run in a modern, recent version of Internet Explorer (version 7), what technique should I use for positioning of controls, and why?

+2  A: 

If you're going to use the graphical UI designer, then Flow Layout is still preferable.

Remember, though, that you still have the ability to do the same kind of CSS design in a .NET 2.0 Webforms app as you do with any ASP.NET MVC app. As long as you build your ASPX by hand (rather than using the designer) you have full control over positioning on the page.

Justin Niessner
Really? If so that's good to hear. But I thought that many of the ASP.NET controls are not CSS-friendly which would make it difficult to use CSS positioning.
Charlie Flowers
The only real pain in the ass is the GridView which renders as a table. You can still style it, it's just a little harder.
Justin Niessner
OK, I think this question cuts to the chase: what is it that the VS.Net designer does badly at absolute positioning, but that CSS does well about absolute positioning? Why is CSS positioning OK across different screen resolutions, but the VS.Net absolute approach is not?
Charlie Flowers
Well, I don't advocate absolute positioning at all so I'm really not the person to answer the question.
Justin Niessner
I think I will turn that into its own separate question.
Charlie Flowers
A: 

I had developed a small intranet ASP.NET application in .NET 2.0. After a lot of trial and error with absolute & relative positioning of the controls, these were my lessons: 1. Its difficult to make a decison on what layout to have. With multiple versions of browsers (IE 6, 7 8) & multiple brands (IE, Mozilla Firefox, Chrome) in use., whatever you try, you CANNOT get the best in everything. You will have to decide that based on the majority of your client base. 2. Also My end users have screen resolution ranging from 1024*768 to 1078 *1024. Hence here absolute layout will just make yur website look funny.

What I did was put my user control in a table (sometimes multiple tables in same table), & adjust the table to take the whole page. This way the layout in a mix between absolute & flow.

Finally its your take.

Ganesh R.
Ugh, I'm afraid I may have to do that, but I want to avoid it at all cost. It is a hodgepodge of all the poor practices from the past ... tables to control layout and non-standards based absolute positioning. But I see why you did it and appreciate the response.
Charlie Flowers