Extending WebControl - PropertyGrid to hold LinkButton

K

Kevin

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top