Visual Web Developer 2010 Cómo utilizar el posicionamiento absoluto en un formulario web asp.net

I'm just starting with using VWD and asp.net to create web sites. I can't get a handle on how to use absolute positioning of asp server controls like the label, textbox, dropdown, etc. on a web form.

I've set the option in settings under CSS styling to change positioning to absolute when dragged from toolbox.

I've set the web form to use absolute positioning at every tag and property I can find. When I first add the web form, I select absolute positioning. For each control I set absolute positioning and so on. I can see the tags in the source have the style property setup with position: absolute.

But the controls on the form will not move on the page to a absolute position.

Sometimes I can get a button or textbox to move, but not always.

I'm used to designing windows forms and this has been very frustrating. It is not very intuitive. Is there a step by step set of instructions on how to use absolute positioning on a web form in msdn/help, etc.

preguntado el 08 de enero de 11 a las 23:01

1 Respuestas

short answer, don't, unless you absolutely have to. You're much better off learning how web pages handle positioning and working with it, b/c otherwise you have a strong potential of setting up all kinds of usability problems for your users with screen sizes that you didn't expect, etc.

Respondido el 09 de enero de 11 a las 02:01

Thanks for the reply. What then is the standard way for organizing server controls on a web form? The method I see most often is using tables to contain the controls. But in some places I see don't recommend this way. I'm not sure which method is generally accepted. - grajilla

Modern best practices for this kind of thing is to learn HTML and CSS, and use them the wya they're intended to organize your stuff based on semantics. So if you're making a list of things, use UL and OL. If you're grouping things into arbitrary regions, use Divs. if you need things next to each other, use CSS float or positioning in the stylesheet, on the containing elements. - paul

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.