CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2002
    Posts
    1,798

    How do you set the postion of a web page control?

    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.
    mpliam

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: How do you set the postion of a web page control?

    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.
    Last edited by Alsvha; June 6th, 2010 at 04:50 AM.

  3. #3
    Join Date
    May 2002
    Posts
    1,798

    Re: How do you set the postion of a web page control?

    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.
    Last edited by Mike Pliam; June 8th, 2010 at 02:14 AM.
    mpliam

  4. #4
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: How do you set the postion of a web page control?

    Quote Originally Posted by Mike Pliam View Post
    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.

  5. #5
    Join Date
    May 2002
    Posts
    1,798

    Re: How do you set the postion of a web page control?

    Extremely helpful info. Thanks.
    mpliam

  6. #6
    Join Date
    Jun 2010
    Location
    Cairo, Egypt
    Posts
    17

    Re: How do you set the postion of a web page control?

    Quote Originally Posted by Mike Pliam View Post
    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
    You Don't Have to Rate Me.
    I'm Not a Civilized Man I'm the Civilization it self
    White or Black, Living or Dieing and 0 or 1 that's MY life
    iam an Object in Object Oriented Life
    010011000111010101110110001000000100110101111001001000000101000001100011

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured