ImageUrlEditor on subcontrol does not work

Discussion in 'ASP .Net Web Controls' started by Ray, Jun 6, 2004.

  1. Ray

    Ray Guest

    I have a WebControl which contains another WebControl. Both have an ImageUrl property, code see below
    In the property grid the ImageUrlEditor works on the parent control but not on the subcontrol's expanded property
    This may or may not be related with the problem that other subproperties are not refreshed automatically and that the subproperty's designer is never called
    Thanks for any suggestions
    Ra

    namespace Test

    [ ParseChildren(false)
    ToolboxData("<{0}:TestControl runat=server></{0}:TestControl>")
    public class TestControl : System.Web.UI.WebControls.WebContro

    private Tests.SubControl tsc = new SubControl()
    private string mstrImageUrl = string.Empty

    [ Description("Test subproperty.")
    DesignerSerializationVisibility(DesignerSerializationVisibility.Content)
    PersistenceMode(PersistenceMode.InnerProperty)
    public Tests.SubControl SubControl
    get { return tsc;
    set { tsc = value;


    [ DefaultValue("")
    Editor(typeof(System.Web.UI.Design.ImageUrlEditor),typeof(System.Drawing.Design.UITypeEditor))
    public string ImageUrl
    get { return mstrImageUrl;
    set { EmstrImageUrl = value;

    } //END public class TestContro

    public class SubControl : System.Web.UI.WebControls.WebContro

    private string mstrImageUrl = string.Empty

    [ DefaultValue("")
    Editor(typeof(System.Web.UI.Design.ImageUrlEditor),typeof(System.Drawing.Design.UITypeEditor))
    public string ImageUrl
    get { return mstrImageUrl;
    set { mstrImageUrl = value;

    } //END public class SubContro

    } //END namespace Tests
    Ray, Jun 6, 2004
    #1
    1. Advertising

  2. Ray

    Ray Guest

    I found the answer to the main question in another forum: This seems
    to be a MS known issue, see http://www.asp.net/Forums/ShowPost.aspx?
    tabindex=1&PostID=269214.

    The subproperty refresh can be fixed by applying the
    NotifyParentPropertyAttribute to the property. I had to override the
    property to set the attribute and make it work.

    So there remains the 'subproperty's designer is never called'
    question. Any help?

    Cherio
    Ray
    Ray, Jun 11, 2004
    #2
    1. Advertising

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. Bonj
    Replies:
    1
    Views:
    2,056
    John M Deal
    Nov 13, 2004
  2. Ben Dewey
    Replies:
    3
    Views:
    4,840
    Ben Dewey
    Nov 1, 2005
  3. James Williams

    ImageUrlEditor will not open

    James Williams, Sep 20, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    125
    James Williams
    Sep 20, 2003
  4. James Geurts

    Getting a subcontrol to work in a repeater

    James Geurts, Feb 17, 2004, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    109
    Jeffrey Tan[MSFT]
    Feb 18, 2004
  5. Fred Hirschfeld

    DataBinding to a subcontrol...

    Fred Hirschfeld, Sep 18, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    129
    Fred Hirschfeld
    Sep 18, 2004
Loading...

Share This Page