Extending WebControl - PropertyGrid to hold LinkButton

Discussion in 'ASP .Net Web Controls' started by Kevin, Jan 2, 2008.

  1. Kevin

    Kevin Guest

    Hi there,

    I am trying to inherit from an existing webcontrol, however I want to add a
    property to the control that will be exposable in the property grid. The
    property in question has a type of LinkButton. I want to define the
    LinkButton that this control must use(I want to hook it's click event up) at
    design time. However I'm having problems with setting it. The property
    appears, and lists any current LinkButtons on my webform in a dropdown list,
    which is great, but when I select a value, I get the following error similar
    to:

    "System.Web.HttpParseException: Cannot create an object of type
    'System.Web.UI.WebControls.LinkButton' from its string representation
    'linkButtonGo' for the 'GoButton' property."

    I think I have to implement a TypeConverter or something along those lines,
    but I haven't had any success with that becasue quite frankly im not too sure
    exaclty what I need to do to prevent this exception. Can someone please help
    me out here?

    Thanks in advance,
    Kevin
     
    Kevin, Jan 2, 2008
    #1
    1. Advertisements

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. SoftLion

    problem extending a webcontrol

    SoftLion, Jun 15, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    524
    John Saunders
    Jun 15, 2004
  2. Guest
    Replies:
    2
    Views:
    904
  3. Sathyaish
    Replies:
    3
    Views:
    3,381
    Sathyaish
    Sep 8, 2005
  4. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    409
    Luis Ramírez
    Jul 6, 2004
  5. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    322
    Kasabaarde Sumta
    Dec 13, 2004
  6. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    329
    Fabricio
    Sep 21, 2005
  7. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    351
    Sathyaish
    Sep 8, 2005
  8. Dave

    LinkButton Inherited from WebControl problem?

    Dave, Jun 22, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    193
    Teemu Keiski
    Jun 23, 2004
Loading...