ImageUrlEditor will not open

J

James Williams

Hello,

I'm trying to create a server control, and am having difficulty getting a
child hyperlink control to display the ImageUrlEditor at design time.

In my webcontrol, I've created a control HyperLink _openHyperLink which is
instantiated in the constructor.

I have a custom style property (below) that implements style and adds the
ImageUrl property. At design time, the Style does expand, but when I click
on the ImageUrl button to open up the ImageUrlEditor, nothing happens. Any
suggestions?

public virtual HyperLinkStyle OpenHyperLinkStyle
{
get
{
if (_openHyperLinkStyle == null)
{
_openHyperLinkStyle = new HyperLinkStyle( _openHyperLink );
if (IsTrackingViewState)
{
((IStateManager)_openHyperLinkStyle ).TrackViewState();
}
}
return _openHyperLinkStyle;
}
}

public class HyperLinkStyle : Style
{
private HyperLink owner;

public HyperLinkStyle( HyperLink owner )
{
this.owner = owner;
this.owner.Text = "HyperLink";
}

[
Bindable(true),

DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
NotifyParentProperty(true),
Editor(typeof(ImageUrlEditor),typeof(UITypeEditor)),
DefaultValue("")
]
public string ImageUrl
{
get
{
return this.owner.ImageUrl;
}
set
{
this.owner.ImageUrl = value;
}
}
}
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top