N2Cms, Adding a new property to a ContentPageBase class, corrupts the already entered data.

Posted by Nour Sabouny on Stack Overflow See other posts from Stack Overflow or by Nour Sabouny
Published on 2011-01-01T16:51:58Z Indexed on 2011/01/03 11:53 UTC
Read the original article Hit count: 264

Filed under:
|

i want to modify the ContentPageBase, in a functional site, i tried to add a property called for example (weight), but if there is an existing page in the database, the site will malfunction, and throws an Exception, of (Object reference not set to an instance of an object).

how can i correct the already entered data ?

public abstract class ContentPageBase : PageBase, ICommentable
{
   [EditableTextBox("Weight", 10, ContainerName = Tabs.Details)]
        //newly added property.
        public virtual int Weight
        {
            get { return (int)GetDetail("Weight"); }
            set { SetDetail("Weight", value); }
        }
}

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about n2cms