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.
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.