ServerControl property defined as Interface isn't available in Intellisense
-
I am creating a server control library and I have a control which has a property named menu. The menu property can be a any server control which inherits from a class named MenuBaseItem. The property is currently defined like this:
[NotifyParentProperty(true)] [PersistenceMode(PersistenceMode.InnerProperty)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public List<MenuBaseItem> items { get { return _items; } }
What I'd like to be able to do is use an interface instead:[NotifyParentProperty(true)] [PersistenceMode(PersistenceMode.InnerProperty)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public List<IMenuItem> items { get { return _items; } }
The above interfaceIMenuItem
will allow an object to convert itself to a menu item so I can include other types as menu items. My problem is that this will compile, but when I open my aspx template and try to edit the property I no longer get any intellisense list of controls which can be used. Is there another interface which must be implmented as part of IMenuItem that will allow intellisense to work with my solution?Code responsibly: OWASP.org Mark's blog: developMENTALmadness.blogspot.com