Control Designer change property but does not persist

V

Vipeo

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.
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top