Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Control Designer change property but does not persist (http://www.velocityreviews.com/forums/t758132-control-designer-change-property-but-does-not-persist.html)

Vipeo 01-12-2006 10:02 AM

Control Designer change property but does not persist
 
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(DesignerSerializat ionVisibility.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.


All times are GMT. The time now is 08:21 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.