Click to See Complete Forum and Search --> : How do you set the postion of a web page control?
Mike Pliam
June 5th, 2010, 05:23 PM
If one drags a control, say a button, from the Toolbox (VS 2008 - ASP.NET Website) to the default.aspx page in Design view, the button will always appear next to the last control entered, or if none has been entered, the upper left-hand corner of the page. Is there a way to manipulate this button to some absolute position on the page? The only properties I find in the button properties list is Height and Width. Perhaps a style sheet (*.css) is the way to set the button absolute position, but I can find no examples of such.
Please help. :)
Alsvha
June 6th, 2010, 04:48 AM
You use stylesheet and HTML to position the rendered controls/html.
Stylesheet is however a vast topic, so if just starting out, I'd advice you to build your page using html tables and position your controls inside those.
Once you get the hang of it - move on to learning about stylesheets and relative positioning.
Mike Pliam
June 8th, 2010, 02:11 AM
Thanks. Tables work. Style sheets are much more complex, but I've made some headway. How do position a asp:ContentPlaceHolder ? Same way using it's id and a # entry in the CSS. :)
Alsvha
June 8th, 2010, 05:59 AM
Thanks. Tables work. Style sheets are much more complex, but I've made some headway. How do position a asp:ContentPlaceHolder ? Same way using it's id and a # entry in the CSS. :)
You don't position a ContentPlaceHolder as it is only a - well placeholder for content.
You position the content via the HTML it renders.
So you could place your ContentPlaceHolder within some HTML div or tables and position those, and that way assure that all content within the placeholder is positioned the same.
Mike Pliam
June 8th, 2010, 11:05 AM
Extremely helpful info. Thanks. :)
avrail
June 26th, 2010, 12:55 PM
If one drags a control, say a button, from the Toolbox (VS 2008 - ASP.NET Website) to the default.aspx page in Design view, the button will always appear next to the last control entered, or if none has been entered, the upper left-hand corner of the page. Is there a way to manipulate this button to some absolute position on the page? The only properties I find in the button properties list is Height and Width. Perhaps a style sheet (*.css) is the way to set the button absolute position, but I can find no examples of such.
Please help. :)
hay,
actually there is another way to do that,
- using tables , i always do this,
- another thing is to use the formate from the VS menu in the design mode after inserting the control to the page, and then select the position then chose relative,
after this you can move it like the desktop applications
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.