Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Control Designer change property but does not persist

Reply
Thread Tools

Control Designer change property but does not persist

 
 
Vipeo
Guest
Posts: n/a
 
      01-12-2006
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Building Controls 3 07-30-2007 09:09 PM
Why the designer doesn't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net 0 12-02-2005 05:16 PM
Why the designer doesn't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net Web Controls 0 12-02-2005 05:16 PM
Why the designer don't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net 0 11-29-2005 01:04 AM
Why the designer don't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net Web Controls 0 11-29-2005 01:04 AM



Advertisments