Pages Html

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

Home |  Readme

[Container] attribute | The OWIN Framework Pages

The [Container] Attribute

You can attach this attribute to any visual page element to define which html element it will render to contain its content.

Example Usage

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

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


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

If you do not attach a Container attribute to a page element, then its contents will be rendered bare, without any container element.


Setting this property adds a class attribute to the container that is rendered around the content.

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.