Hi Chris,
My property attributes are below and as you can see I added the DesignerSerializationVisibility and PersistenceMode attribute to my
property as you suggested.
[EditorAttribute( "TabEditor",typeof( System.Drawing.Design.UITypeEditor )),
DesignerSerializationVisibility( DesignerSerializationVisibility.Content ),
PersistenceMode( PersistenceMode.Attribute )]
public String[] TabCaptions
{
get
{
return tabCaptions;
}
set
{
tabCaptions = value;
}
}
private String[] tabCaptions;
When I set the string values i.e. TabCaptons via the editor for my control on an aspx page I get the below in Html view from the
aspx page.
<cc1:NP_TabStrip id=NP_TabStrip1 runat="server" TabCaptions-Rank="1" TabCaptions-IsReadOnly="False"
TabCaptions-SyncRoot="System.String[]" TabCaptions-IsSynchronized="False" TabCaptions-IsFixedSize="True" TabCaptions-Length="4"
TabCaptions-LongLength="4" TabCaptions="String[] Array">
This gives me a parser error below when trying to render the page in the browser
Parser Error Message: Cannot create an object of type 'System.String[]' from its string representation 'String[] Array' for the
'TabCaptions' property.
Again below is my designer class.
using System;
using System.ComponentModel.Design;
namespace NetParadigm.WebServerControls
{
public class TabEditor : ArrayEditor
{
public TabEditor() : base (typeof ( String ) )
{
}
}
}
Any ideas on whats wrong? Thanks Chris!
<nospam="pehli1@hotmail.com"/><nospam>
[quoted text, click to view] "ChrisAdams" <ChrisAdams@discussions.microsoft.com> wrote in message news:2F540031-C865-482D-9959-3D1E02128BE7@microsoft.com...
> You need to change the default serialization behaviour that the designer uses
> by
> adding attributes to the property.
>
> [DesignerSerializationVisibility( DesignerSerializationVisibility.Content ),
> PersistenceMode( PersistenceMode.Attribute )]
>
> This should force the dte to serialize the content of your property ie the
> string values, instead of the property itself, ie an array.
>
> Chris