N2CMS

N2.Futures

A collection of miscellaneous utilities for N2 framework and ASP.Net platform in general. To name a few:

- Strongly typed wrappers over DetailCollection, which allow modifying collection through generic .Net interfaces IDictionary and IList. (Note: a patch is included to enable DetailCollection used as IDictionary)

- [EditableUserControlAttribute] allowing usage of a User Control (.ascx) as item property editor

- UserTree Web Control, used for selection of standard ASP.Net membership Users and Roles (include a dedicated demo control for feature exploration)

- minor handy tweaks and fixes for ASP.Net server controls, such as validation-enabled CheckBoxList wrapper

Installation:

1. Include .csproj project into your solution
2. Update references to N2 and libraries

Usage:

1. Encapsulate access to a DetailCollection using wrappers:

public IList MyProperties {
get { return this.GetDetailCollection("MyDetails", true).AsList(); }
}

Now you'll be able to add new property to collection by calling MyProperties.Add(new MyProperty(..)) without resorting to assign a whole collection (notice: there's no setter required).

2. To edit property with a user control, decorate either said property or a whole item with appropriate attribute, for instance the second case:

[WithEditableUserControl("My Property", "~/MySite/UI/MyControl.ascx", "", "CurrentItem", 100, "")]
public class MyEntity: N2.ContentItem
{
..

3. To explore features of UserTree control, drop a demo on your web form:


...


11/17 3:08:05 PM

esteewhy

Library

4290

474

None

Download Homepage Source Code Edit Addon


« Back