How to add Style property to User Control

Discussion in 'ASP .Net Building Controls' started by Steve Trandahl, Oct 29, 2007.

  1. I am trying to add a simple Style property to our base User Control. Even if
    I add it as a simple string type, I get the error "Operation GetValue on the
    component did not succeed, generating the error code 0x80020005." in the
    property window for the property. It seems to be indicating a type mismatch.
    If I rename the property to something else, it works fine. Since User
    Controls don't have a style property to hide or override, why am I getting
    this problem?
    Steve Trandahl, Oct 29, 2007
    #1
    1. Advertising

  2. I also got into the same situation. Will appreciate if anyone has the
    solution.
    thanks
    On Oct 29, 11:17 am, Steve Trandahl
    <> wrote:
    > I am trying to add a simple Style property to our base User Control. Even if
    > I add it as a simple string type, I get the error "Operation GetValue on thecomponentdid not succeed, generating the error code0x80020005." in the
    > property window for the property. It seems to be indicating a type mismatch.
    > If I rename the property to something else, it works fine. Since User
    > Controls don't have a style property to hide or override, why am I getting
    > this problem?
    Aamir Ghanchi, Nov 27, 2007
    #2
    1. Advertising

  3. Steve, did you ever find the solution to this problem? I am running into it
    as well.

    Thanks,
    Gerry

    "Steve Trandahl" wrote:

    > I am trying to add a simple Style property to our base User Control. Even if
    > I add it as a simple string type, I get the error "Operation GetValue on the
    > component did not succeed, generating the error code 0x80020005." in the
    > property window for the property. It seems to be indicating a type mismatch.
    > If I rename the property to something else, it works fine. Since User
    > Controls don't have a style property to hide or override, why am I getting
    > this problem?
    Gerry Polucci, Dec 1, 2007
    #3
  4. Unfortunately no. I ended up naming the property ControlStyle. It still
    renders a style tag in the control, but I didn't figure out how to name the
    property Style. :(

    "Gerry Polucci" wrote:

    > Steve, did you ever find the solution to this problem? I am running into it
    > as well.
    >
    > Thanks,
    > Gerry
    >
    > "Steve Trandahl" wrote:
    >
    > > I am trying to add a simple Style property to our base User Control. Even if
    > > I add it as a simple string type, I get the error "Operation GetValue on the
    > > component did not succeed, generating the error code 0x80020005." in the
    > > property window for the property. It seems to be indicating a type mismatch.
    > > If I rename the property to something else, it works fine. Since User
    > > Controls don't have a style property to hide or override, why am I getting
    > > this problem?
    Steve Trandahl, Dec 2, 2007
    #4
    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. Mad Scientist Jr
    Replies:
    0
    Views:
    624
    Mad Scientist Jr
    Mar 22, 2006
  2. Chad Scharf
    Replies:
    3
    Views:
    851
    Chad Scharf
    Oct 18, 2007
  3. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    526
    Jonathan Wood
    Feb 2, 2010
  4. Ken Varn
    Replies:
    0
    Views:
    427
    Ken Varn
    Apr 26, 2004
  5. Sky
    Replies:
    2
    Views:
    275
    Robert Koritnik
    Oct 1, 2004
Loading...

Share This Page