How do I get absolute position deriving from Control instead of WebControl?

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Re: How do I get absolute position deriving from Control instead of WebControl?

    I remember Nikhil Kothari discussing about this at ASP.NET Forums and he
    said it is impossible unless you derive from WebControl.

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    [url]http://www.mansoft.fi[/url]

    AspInsiders Member, [url]www.aspinsiders.com[/url]
    ASP.NET Forums Moderator, [url]www.asp.net[/url]
    AspAlliance Columnist, [url]www.aspalliance.com[/url]

    "Rob Mayo" <Rob.Mayo@WestonSolutions.com> wrote in message
    news:%23EgLmUUTDHA.2480@tk2msftngp13.phx.gbl...
    I have a server control that I derived from
    System.Web.UI.WebControls.WebControl. I want the change it to derive from
    System.Web.UI.Control so that it does not have all the extraneous
    properties. Like a superfluous third nipple, I want them gone.

    I can live with not having Height, Width, or TabIndex. I used to just take
    these properties and insert them into the content I produced from my
    overridden Render. I can implement these myself. No problem

    I used to take the Attributes property, grab Style from if and plop it in my
    rendered content to absolutely/relatively position my control. The
    Attributes property never existed in Control.

    How can I get the position of my control if the page is in GridLayout or
    FlowLayout when deriving from Control?

    -------vbcode-------
    Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
    strObjectText = Replace(strObjectText, "[ABSPOSTOKEN]",
    Me.Attributes("style"))
    Return strObjectText
    End Sub


    Teemu Keiski Guest

  2. Similar Questions and Discussions

    1. Position Absolute (CSS) in IE and Firefox
      :confused; I don't know if my problem is (a) a CSS issue/mistake (b) a discrepancy between browsers or (c) an issue with the PVII ShowPic...
    2. How to position a custom webcontrol relatively under vs.net 2005?
      When I update my webcontrol form .net 2003 to .net 2005, one question occured. My webcontrol can not be moved when it is put on a web form....
    3. anchor to link to an absolute position
      I'm a newbie to this forum. Just installed Studio 8. Been building sites with MS FrontPage, so bare with me. Thanks. I want the anchor to link to...
    4. Center image using position: absolute?
      I have an image (it's a navigation bar) that should appear with a specifc vertical position; so I'm using absolute positioning to put it a precise...
    5. ASP.NET Custom WebControl Absolute Positioning
      Hi, I'm currently in the process of building a custom webcontrol. I nearly finished it, however one thing is a mystery to me: how do i enable the...
  3. #2

    Default Re: How do I get absolute position deriving from Control instead of WebControl?

    I very much doubt that. Logically it doesn't make sense. If WebControl
    derives from Control, then how does WebControl do it? Somewhere someone
    wrote the code to posittion a WebControl. All I want is that code, you know?

    "Teemu Keiski" <joteke@aspalliance.com> wrote in message
    news:OI5ihuVTDHA.1916@TK2MSFTNGP12.phx.gbl...
    > I remember Nikhil Kothari discussing about this at ASP.NET Forums and he
    > said it is impossible unless you derive from WebControl.
    >
    > --
    > Teemu Keiski
    > MCP, Designer/Developer
    > Mansoft tietotekniikka Oy
    > [url]http://www.mansoft.fi[/url]
    >
    > AspInsiders Member, [url]www.aspinsiders.com[/url]
    > ASP.NET Forums Moderator, [url]www.asp.net[/url]
    > AspAlliance Columnist, [url]www.aspalliance.com[/url]
    >
    > "Rob Mayo" <Rob.Mayo@WestonSolutions.com> wrote in message
    > news:%23EgLmUUTDHA.2480@tk2msftngp13.phx.gbl...
    > I have a server control that I derived from
    > System.Web.UI.WebControls.WebControl. I want the change it to derive from
    > System.Web.UI.Control so that it does not have all the extraneous
    > properties. Like a superfluous third nipple, I want them gone.
    >
    > I can live with not having Height, Width, or TabIndex. I used to just take
    > these properties and insert them into the content I produced from my
    > overridden Render. I can implement these myself. No problem
    >
    > I used to take the Attributes property, grab Style from if and plop it in
    my
    > rendered content to absolutely/relatively position my control. The
    > Attributes property never existed in Control.
    >
    > How can I get the position of my control if the page is in GridLayout or
    > FlowLayout when deriving from Control?
    >
    > -------vbcode-------
    > Protected Overrides Sub Render(ByVal output As
    System.Web.UI.HtmlTextWriter)
    > strObjectText = Replace(strObjectText, "[ABSPOSTOKEN]",
    > Me.Attributes("style"))
    > Return strObjectText
    > End Sub
    >
    >

    Rob Mayo Guest

  4. #3

    Default Re: How do I get absolute position deriving from Control instead of WebControl?

    Yeah, it doesn't. I believe the IDE has also something to say about that (as
    controls are positioned there, although it just should be attributes that
    handle the placing) . Sure it is coded somewhere. You might just need
    appropriate tools to dig it out.

    The thread at ASP.NET forums I mentioned:
    [url]http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=221779[/url]

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    [url]http://www.mansoft.fi[/url]

    AspInsiders Member, [url]www.aspinsiders.com[/url]
    ASP.NET Forums Moderator, [url]www.asp.net[/url]
    AspAlliance Columnist, [url]www.aspalliance.com[/url]


    "Rob Mayo" <Rob.Mayo@WestonSolutions.com> wrote in message
    news:eKY1GzVTDHA.1868@TK2MSFTNGP11.phx.gbl...
    > I very much doubt that. Logically it doesn't make sense. If WebControl
    > derives from Control, then how does WebControl do it? Somewhere someone
    > wrote the code to posittion a WebControl. All I want is that code, you
    know?
    >
    > "Teemu Keiski" <joteke@aspalliance.com> wrote in message
    > news:OI5ihuVTDHA.1916@TK2MSFTNGP12.phx.gbl...
    > > I remember Nikhil Kothari discussing about this at ASP.NET Forums and he
    > > said it is impossible unless you derive from WebControl.
    > >
    > > --
    > > Teemu Keiski
    > > MCP, Designer/Developer
    > > Mansoft tietotekniikka Oy
    > > [url]http://www.mansoft.fi[/url]
    > >
    > > AspInsiders Member, [url]www.aspinsiders.com[/url]
    > > ASP.NET Forums Moderator, [url]www.asp.net[/url]
    > > AspAlliance Columnist, [url]www.aspalliance.com[/url]
    > >
    > > "Rob Mayo" <Rob.Mayo@WestonSolutions.com> wrote in message
    > > news:%23EgLmUUTDHA.2480@tk2msftngp13.phx.gbl...
    > > I have a server control that I derived from
    > > System.Web.UI.WebControls.WebControl. I want the change it to derive
    from
    > > System.Web.UI.Control so that it does not have all the extraneous
    > > properties. Like a superfluous third nipple, I want them gone.
    > >
    > > I can live with not having Height, Width, or TabIndex. I used to just
    take
    > > these properties and insert them into the content I produced from my
    > > overridden Render. I can implement these myself. No problem
    > >
    > > I used to take the Attributes property, grab Style from if and plop it
    in
    > my
    > > rendered content to absolutely/relatively position my control. The
    > > Attributes property never existed in Control.
    > >
    > > How can I get the position of my control if the page is in GridLayout or
    > > FlowLayout when deriving from Control?
    > >
    > > -------vbcode-------
    > > Protected Overrides Sub Render(ByVal output As
    > System.Web.UI.HtmlTextWriter)
    > > strObjectText = Replace(strObjectText, "[ABSPOSTOKEN]",
    > > Me.Attributes("style"))
    > > Return strObjectText
    > > End Sub
    > >
    > >
    >
    >

    Teemu Keiski Guest

  5. #4

    Default Re: How do I get absolute position deriving from Control instead of WebControl?

    I tackle this "resizing and moving" deriving from Control, about a year and
    half ago, just as an experiment while learning how the design-time support
    worked.

    The main issue is that the provided designers, when it comes to moving and
    resizing were built for handling with WebControl-derived classes only, you
    can notice that looking at all the explicit checks that ControlDesigner
    makes looking if its designing a WebControl-derived class. This sounds
    pretty logical also, as WebControl offers the minimum required
    functionallity that is needed in order to be moved and resized while Control
    doesn't provide that.

    That said, you *could* actually make some of this stuff work for a
    Control-derived class. I remember having coding a Control-derived class that
    could be resized and it worked okay. But the additional code required isn't
    worth it when compared to inheriting from WebControl (even if you may be
    inheriting some stuff you don't really want). After giving it a shot, I've
    always recommended several times in many posts to inherit from WebControl in
    order to get this funcionallity.

    btw, it has been publicy said that vNext will include some kind of
    intermeditate control between WebControl and Control just to provide this
    functionallity.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    [url]http://obies.com/vga/blog.aspx[/url]
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Teemu Keiski" <joteke@aspalliance.com> wrote in message
    news:eOhTCYdTDHA.2008@TK2MSFTNGP11.phx.gbl...
    > Yeah, it doesn't. I believe the IDE has also something to say about that
    (as
    > controls are positioned there, although it just should be attributes that
    > handle the placing) . Sure it is coded somewhere. You might just need
    > appropriate tools to dig it out.
    >
    > The thread at ASP.NET forums I mentioned:
    > [url]http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=221779[/url]
    >
    > --
    > Teemu Keiski
    > MCP, Designer/Developer
    > Mansoft tietotekniikka Oy
    > [url]http://www.mansoft.fi[/url]
    >
    > AspInsiders Member, [url]www.aspinsiders.com[/url]
    > ASP.NET Forums Moderator, [url]www.asp.net[/url]
    > AspAlliance Columnist, [url]www.aspalliance.com[/url]
    >
    >
    > "Rob Mayo" <Rob.Mayo@WestonSolutions.com> wrote in message
    > news:eKY1GzVTDHA.1868@TK2MSFTNGP11.phx.gbl...
    > > I very much doubt that. Logically it doesn't make sense. If WebControl
    > > derives from Control, then how does WebControl do it? Somewhere someone
    > > wrote the code to posittion a WebControl. All I want is that code, you
    > know?
    > >
    > > "Teemu Keiski" <joteke@aspalliance.com> wrote in message
    > > news:OI5ihuVTDHA.1916@TK2MSFTNGP12.phx.gbl...
    > > > I remember Nikhil Kothari discussing about this at ASP.NET Forums and
    he
    > > > said it is impossible unless you derive from WebControl.
    > > >
    > > > --
    > > > Teemu Keiski
    > > > MCP, Designer/Developer
    > > > Mansoft tietotekniikka Oy
    > > > [url]http://www.mansoft.fi[/url]
    > > >
    > > > AspInsiders Member, [url]www.aspinsiders.com[/url]
    > > > ASP.NET Forums Moderator, [url]www.asp.net[/url]
    > > > AspAlliance Columnist, [url]www.aspalliance.com[/url]
    > > >
    > > > "Rob Mayo" <Rob.Mayo@WestonSolutions.com> wrote in message
    > > > news:%23EgLmUUTDHA.2480@tk2msftngp13.phx.gbl...
    > > > I have a server control that I derived from
    > > > System.Web.UI.WebControls.WebControl. I want the change it to derive
    > from
    > > > System.Web.UI.Control so that it does not have all the extraneous
    > > > properties. Like a superfluous third nipple, I want them gone.
    > > >
    > > > I can live with not having Height, Width, or TabIndex. I used to just
    > take
    > > > these properties and insert them into the content I produced from my
    > > > overridden Render. I can implement these myself. No problem
    > > >
    > > > I used to take the Attributes property, grab Style from if and plop it
    > in
    > > my
    > > > rendered content to absolutely/relatively position my control. The
    > > > Attributes property never existed in Control.
    > > >
    > > > How can I get the position of my control if the page is in GridLayout
    or
    > > > FlowLayout when deriving from Control?
    > > >
    > > > -------vbcode-------
    > > > Protected Overrides Sub Render(ByVal output As
    > > System.Web.UI.HtmlTextWriter)
    > > > strObjectText = Replace(strObjectText, "[ABSPOSTOKEN]",
    > > > Me.Attributes("style"))
    > > > Return strObjectText
    > > > End Sub
    > > >
    > > >
    > >
    > >
    >
    >

    Victor Garcia Aprea [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139