Search Results

Search found 3 results on 1 pages for 'n2cms'.

Page 1/1 | 1 

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

    - by Nour Sabouny
    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); } } }

    Read the article

  • N2 CMS SlidingCurtain control is not visible

    - by Carl Raymond
    I just set up a new N2 site by starting with the MVC 2 Web Application template in Visual Studio, then following the directions in N2 CMS Developer Documentation in the section Integrating with Existing ASP.NET MVC Application. I have the basic site running now, but with one problem: the sliding curtain widget that holds the administrative controls is not visible in the upper right corner (when logged in, of course). I can make it visible the hard way by using Firebug to locate it in the DOM, and then disabling a couple of the CSS positioning elements. Once I do that, it seems to work normally. After I open it that way, I can click the various controls, or close it up (and I see the animation). But then it's off screen again. My master page has the sliding curtain just inside the <body> tag: <body> <n2:SlidingCurtain runat="server"> <n2:ControlPanel runat="server" /> </n2:SlidingCurtain> ... The site.css file generated in the base MVC site doesn't seem to do any positioning that would affect this. Firebug shows that right after by <body> tag, I have this: <div class="sc" id="SC" style="top: -2px; left: -574px;"><div class="scContent"> .... The style for <div class="sc" ...> is element.style { left:-574px; top:-2px; } .sc { background:#FFFFFF none repeat-x scroll 0 0; border-color:#CCCCBB; border-style:none solid solid none; border-width:1px; left:-200px; position:fixed; top:-200px; z-index:990; } If I disable both top: and both left: rules, the widget appears.

    Read the article

  • Nhibernate one-to-many with table per subclass

    - by Wayne
    I am customizing N2CMS's database structure, and met with an issue. The two classes are listed below. public class Customer : ContentItem { public IList<License> Licenses { get; set; } } public class License : ContentItem { public Customer Customer { get; set; } } The nhibernate mapping are as follows. <class name="N2.ContentItem,N2" table="n2item"> <cache usage="read-write" /> <id name="ID" column="ID" type="Int32" unsaved-value="0" access="property"> <generator class="native" /> </id> <discriminator column="Type" type="String" /> </class> <subclass name="My.Customer,My" extends="N2.ContentItem,N2" discriminator-value="Customer"> <join table="Customer"> <key column="ItemID" /> <bag name="Licenses" generic="true" inverse="true"> <key column="CustomerID" /> <one-to-many class="My.License,My"/> </bag> </join> </subclass> <subclass name="My.License,My" extends="N2.ContentItem,N2" discriminator-value="License"> <join table="License" fetch="select"> <key column="ItemID" /> <many-to-one name="Customer" column="CustomerID" class="My.Customer,My" not-null="false" /> </join> </subclass> Then, when get an instance of Customer, the customer.Licenses is always empty, but actually there are licenses in the database for the customer. When I check the nhibernate log file, I find that the SQL query is like: SELECT licenses0_.CustomerID as CustomerID1_, licenses0_.ID as ID1_, licenses0_.ID as ID2_0_, licenses0_1_.CustomerID as CustomerID7_0_, FROM n2item licenses0_ inner join License licenses0_1_ on licenses0_.ID = licenses0_1_.ItemID WHERE licenses0_.CustomerID = 12 /* @p0 */ It seems that nhibernate believes that the CustomerID is in the 'n2item' table. I don't know why, but to make it work, I think the SQL should be something like this. SELECT licenses0_.ID as ID1_, licenses0_.ID as ID2_0_, licenses0_1_.CustomerID as CustomerID7_0_, FROM n2item licenses0_ inner join License licenses0_1_ on licenses0_.ID = licenses0_1_.ItemID WHERE licenses0_1_.CustomerID = 12 /* @p0 */ Could any one point out what's wrong with my mappings? And how can I get the correct licenses of one customer? Thanks in advance.

    Read the article

1