Custom Web Control & Property Pages

Discussion in 'ASP .Net Web Controls' started by dm_dal, Jul 8, 2004.

  1. dm_dal

    dm_dal Guest

    I'm building a custom web control and was looking at was to add css style
    attributes to my tags. Can I implement a "Style Builder" for my custom
    control?

    I tried creating a property in my control (C#)

    <snippit>

    private CssStyleCollection _style;

    [Browsable(true),Category("Appearance")]
    public CssStyleCollection Style
    {
    get
    {
    return _style,
    }
    set
    {
    _style = value;
    }
    }

    When I place the control on an aspx page, the Style attribute in the design
    properties page is greyed out. When I right click on the placed control,
    the context menu show the "Build Styles" menu item, but it too is greyed
    out.

    Is there a way to do this?
    dm_dal, Jul 8, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    5
    Views:
    985
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  2. Rob Joosen

    Keep custom property-value in custom rendered control

    Rob Joosen, May 12, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    132
    Rob Joosen
    May 12, 2004
  3. Jeremy Chapman

    Custom control with complex property type (System.Web.UI.Control[])

    Jeremy Chapman, Feb 15, 2006, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    157
    Jeremy Chapman
    Feb 15, 2006
  4. Henrik Grotle
    Replies:
    0
    Views:
    100
    Henrik Grotle
    Sep 9, 2003
  5. anon
    Replies:
    0
    Views:
    201
Loading...

Share This Page