Click here to Skip to main content
15,907,493 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a composite control that works fine during runtime. However, during design time I receive an error: " '3' could not be set on property 'TotalItems'".

When I first add this composite control on a page, it is rendered correctly. After I close that page and reopen it, I get this error.

This is what my propery looks like:
[Browsable(true),
 Bindable(true)]
 public long TotalItems
 {
     get
     {
         if (ViewState["TotalItems"] == null) return 10;

         return Convert.ToInt64(ViewState["TotalItems"]);
     }
     set
     {
         ViewState["TotalItems"] = value;

     }
 }


Here is what the class looks like:
    [Designer(typeof(CompositeControlDesigner)),
    ParseChildren(true)]
    public sealed class CustomGrid: CompositeControl, INamingContainer, IEnumerator
    {
...
    }

Here is what the markup looks like:
<cc2:CustomGrid ID="CustomGrid1" runat="server" TotalItems="3"  />


Let me know if any more info is required.

Thanks in advance.
Posted
Updated 19-Jun-10 19:10pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900