Need help with base.Style collection in custom control

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

  1. #1

    Default Need help with base.Style collection in custom control

    Hi,

    Here's my situation: I'm developing a custom control, which basically
    consists of two nested <DIV> tags. Now, i need to obtain base.Style object,
    in order to get the positioning information, if the control is being
    positioned via ABSOLUTE positioning.

    I have tried to used base.RenderBeginTag() and base.RenderEndTag() but the
    the base tag is a <SPAN> an that goes against XHTML formatting rules.

    So my question is: how do i either make a base tag s <DIV> tag instead of a
    <SPAN>, or how do i obtain a valid inline CSS string from base.Style
    preperty? (I tried base.Style.ToString() but that just returns the type of
    the object. I also tried foreach loop on the object, but that collection
    doesn't have an iterator defined)

    TIA
    Nick Goloborodko
    Nick Goloborodko Guest

  2. Similar Questions and Discussions

    1. Collection Property in web custom control
      Hi all, I'm building a custom control. I would like that on the control you can set some 'rights' For that I have an enum: public enum...
    2. Custom Control - Collection Property
      Hey gang. I am taking the task of trying to learn how to write custom web controls. I have started with inheriting from the VS 2005 default which...
    3. Collection Property of Another Custom Server Control
      Hi, I read more and figured out how to build what I needed: <cc> <item></item> <item></item> </cc> when <item> is an editable control in...
    4. Multiple Collection Properties in a Custom Control
      I am attempting to create control with 2 collection properties that are persisted with mode PersistenceMode.InnerProperty. When I create the...
    5. Custom Control nad Collection property
      I have a collection-property on my control. I Add the items through a collection editor, and items tags appears. <bugge:Control>...
  3. #2

    Default Re: Need help with base.Style collection in custom control

    You can derive from WebControl and one of the constructor overloads.
    For example:

    Code:
    ....
    public MyControl() : base("div") {}
    or
    public MyControl() : base(HtmlTextWriterTag.Div) {}
    HTH.

    --
    [url]http://wilcoding.xs4all.nl[/url]

    Wilco Bauwer Guest

  4. #3

    Default Re: Need help with base.Style collection in custom control

    Wilco Bauwer wrote:
    > You can derive from WebControl and one of the constructor overloads.
    > For example:
    >
    >
    Code:
    > ...
    > public MyControl() : base("div") {}
    > or
    > public MyControl() : base(HtmlTextWriterTag.Div) {}
    >
    >
    > HTH.
    >
    > --
    > [url]http://wilcoding.xs4all.nl[/url]
    Thanks :) You've saved me alot of time :)
    Nick Goloborodko 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