Control Designer change property but does not persist

Discussion in 'ASP .Net Building Controls' started by Vipeo, Jan 12, 2006.

  1. Vipeo

    Vipeo Guest

    Hi All,

    I'm developing a custom control for ASP.NET (2.0 but this shouldn't matter).
    I've got a property PageID (Guid) in this control:

    [Designer(typeof(CMSWebPageDesigner)),
    ToolboxData("")]
    public class MyControl : Control
    {
    ....
    private Guid pageId = Guid.Empty;

    [Bindable(false),
    DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
    PersistenceMode(PersistenceMode.Attribute),
    DefaultValue(""),
    Localizable(false)]
    public Guid PageID
    {
    get
    {
    return pageID;
    }
    }
    }

    Also, I have a control designer for this control:

    class PageDesignerEditor : WindowsFormsComponentEditor
    {
    ...
    public override bool EditComponen
    (System.ComponentModel.ITypeDescriptorContext context, object component,
    IWin32Window owner)
    {
    ...
    // creates a DesignerTransaction
    // show a modal dialog (dialog editor)
    // - the property is set by PropertyDescriptor.SetValue(component, value)
    // commit transaction
    }
    }

    A problem = the value gets changed but not persisted in the WebForm source!
    Interestingly, if I change the value of the PageID from Properties toolbox it
    appears in the source HTML!

    I'm missing something here...

    Thank you.
     
    Vipeo, Jan 12, 2006
    #1
    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. Umut Tezduyar
    Replies:
    0
    Views:
    451
    Umut Tezduyar
    Nov 29, 2005
  2. Umut Tezduyar
    Replies:
    0
    Views:
    437
    Umut Tezduyar
    Dec 2, 2005
  3. Alexander Higgins
    Replies:
    3
    Views:
    1,111
    Teemu Keiski
    Jul 30, 2007
  4. Umut Tezduyar
    Replies:
    0
    Views:
    154
    Umut Tezduyar
    Nov 29, 2005
  5. Umut Tezduyar
    Replies:
    0
    Views:
    144
    Umut Tezduyar
    Dec 2, 2005
Loading...

Share This Page