Problems of Defining an Expandable Property for a Web Control in the Designer.

L

Laser Lu

I created a web control with an expandable property, and exposed that property onto the property panel. However, a error occured when I clicked one of the nested properties on the property panel.
That nested property has been associated with the ImageUrlEditor, but when I clicked that property, the editor can not be popped up, instead, an error was alerted. And, other nested properties can work properly
My question is, whether the ImageUrlEditor can work properly for nested properties in the property panel

Here is the code snippet

public class MyImageButton : System.Web.UI.WebControls.Butto

..
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
Category("Appearance"),
NotifyParentProperty(true),
DefaultValue(null),
Description("Set the image of the button displayed in normal cases.")]
public virtual BackgroundImageSetting Imag

ge

return this.image


... // Other properties


[TypeConverter(typeof(ExpandableObjectConverter))
public class BackgroundImageSettin

..
[Editor("System.Web.UI.Design.ImageUrlEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor)),
NotifyParentProperty(true),
DefaultValue(""),
Description("Set the URL of the image file."),
Category("Appearance"),
RefreshProperties(RefreshProperties.Repaint),
Bindable(true)
public string Ur

ge

return this.url

se

this.url = value


... // Other nested properties
 
L

Laser Lu

Help

----- Laser Lu wrote: ----

I created a web control with an expandable property, and exposed that property onto the property panel. However, a error occured when I clicked one of the nested properties on the property panel.
That nested property has been associated with the ImageUrlEditor, but when I clicked that property, the editor can not be popped up, instead, an error was alerted. And, other nested properties can work properly
My question is, whether the ImageUrlEditor can work properly for nested properties in the property panel

Here is the code snippet

public class MyImageButton : System.Web.UI.WebControls.Butto

..
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
PersistenceMode(PersistenceMode.InnerProperty),
Category("Appearance"),
NotifyParentProperty(true),
DefaultValue(null),
Description("Set the image of the button displayed in normal cases.")]
public virtual BackgroundImageSetting Imag

ge

return this.image


... // Other properties


[TypeConverter(typeof(ExpandableObjectConverter))
public class BackgroundImageSettin

..
[Editor("System.Web.UI.Design.ImageUrlEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor)),
NotifyParentProperty(true),
DefaultValue(""),
Description("Set the URL of the image file."),
Category("Appearance"),
RefreshProperties(RefreshProperties.Repaint),
Bindable(true)
public string Ur

ge

return this.url

se

this.url = value


... // Other nested properties
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top