Web User Control Collection data is not storing

issue:

I wanted to create a web control which has collection featured in the ASPX. I have code below which has a problem.

I seem to turn off and objects collection editor(collection stable).But I object design information Design Time at runtime what you can not get

when I turn off the project.So in a way the information will be saved during design is disappear.

When I open the project files in aspx file nor what. Designer.cs do not coincide in any record in the file.

I want to show in the picture below, this situation partially.

Based on the above, or as seen in the example in asp.net collection listing on sample collection can fix or waiting for your advice.

Collection Editor

Result

Here is sample project. https://dl.dropboxusercontent.com/u/69846096/Forums/Demo_2014_03_27_08_48_47.rar 

And here for SkyDrive https://onedrive.live.com/redir?resid=F3BB0CC9810290B7!1748&authkey=!AD8_R5JIDQjWzUg&ithint=file%2c.rar

Here is property

solution:

[PersistenceMode(PersistenceMode.InnerProperty)]

Here is sample usage

privateRoller roller;[Editor(typeof(RolCollectionEditor),typeof(System.Drawing.Design.UITypeEditor))][DesignerSerializationVisibility(DesignerSerializationVisibility.Content)][PersistenceMode(PersistenceMode.InnerProperty)]publicRollerRoller{
            get
            {if(roller ==null){
                    roller =newRoller();}return roller;}}
原文地址:https://www.cnblogs.com/happy-Chen/p/3629949.html