Pages Html

NuGet packageOwin.Framework.Pages.Html
GitHub sourceOwinFramework.Pages.Html

Home |  Readme

[ChildContainer] attribute | The OWIN Framework Pages

The [ChildContainer] Attribute

You can attach this attribute to any page element that is a container of other page elements and it will define the html element to use as a container for each of the children.

Example Usage

[Container("ul", "{ns}_menu")]
[ChildContainer("li", "{ns}_menu-item")]
public class MenuRegion

The [ChildContainer()] attribute has the following properties you can set.


This property must contain the tag name of an Html container element. If you attach a ChildContainer attribute without setting the Tag property, then it will default to <div>.

If you do not attach a ChildContainer attribute to a page element that has children, then the children will be rendered bare, without any container element.


Setting this property adds a class attribute to the container that is rendered around each child element.

You can include multiple class names separated by spaces.

If you are using CSS prefixes for package namespaces (recommended) then you can add the appropriate package namespace prefix to your class names by using the special {ns}_ marker in front of each class name that you want to be prefixed.