Set Location of control programatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Tmlrb2xheSBQb2Rrb2x6aW4=?=

    Set Location of control programatically

    Goon afternoon, Community! I'm sorry for a post in wrong place, but couldn't
    find more appropriate place for that.



    Could you be so kind and help me with dynamic creating controls in asp.net.
    I need to set a positions of control programaticall.



    How could I do that?



    Thanks In advance.

    Best Regards, Nikolay

  • Alberto Poblacion

    #2
    Re: Set Location of control programatically

    "Nikolay Podkolzin" <NikolayPodkolz in@discussions. microsoft.comwr ote in
    message news:DD05769F-E4D0-44A0-B8E0-07F133C94C0F@mi crosoft.com...
    Could you be so kind and help me with dynamic creating controls in
    asp.net.
    I need to set a positions of control programatically .
    In ASP.NET your servers controls are going to produce HTML which is then
    sent to the browser. It is the browser the one that interprets the HTML and
    positions the controls according to the contents. Therefore, you need to
    think about what kind of HTML you want to generate, and write server code
    that produces that HTML.
    For instance, one way to position the controls on screen is to generate a
    TABLE and then place your controls inside the cells of the table. When
    generating this on the server side, you would create HtmlTableCell controls
    which you would add to the Cells collection of your HtmlTableRow controls,
    which you add to the Rows collection of a HtmlTable. All of them can be
    dynamically created as server controls.
    Another way is to add a Style to the controls you are producing, and
    write a "position:absol ute;top:30px;le ft:80px;" (for instance) inside the
    Style. Be warned that this position is relative to the container of the
    control.

    Comment

    Working...