M# Tutorials

Learn to build .NET applications with M#. Our step-by-step tutorials will get you up-to-speed rapidly.
If you already know ASP.NET and C#, you can master M# in a week or two.

Module Header and Footer

In this lesson we will learn two very useful module attributes used to customize header and footer contents of each module.

Module Header

M# provides this attribute to customize the header contents of a module and allows you to provide custom HTML markup with static or dynamic contents. M# embeds the HTML markup and contents just above the module elements. The contents are embedded without any modification. This attribute is available for all modules.

The screenshot below demonstrates the usage of a View module of entity type “Employee”. The view module contains only one element “Email”.

Important: M# provides another attribute “Header text”. This attribute wraps the contents specified inside h2 HTML tag. This should not be confused with the “Header” attribute we are learning in this lesson. The “Header Text” contents are rendered above “Header” attributes contents.

The screenshot above shows that we have used HTML tag h1 with dynamic contents using ASP.NET server tags. M# generates the Module markup by placing this above the elements section, as shown below:

Module Footer

This attribute is used to apply custom markup and contents below the module elements. Any markup specified in this attribute is generated at the bottom of the module. You can specify any type of contents e.g. referencing any other module, custom markup, including files etc.

The below screenshots show how you can specify footer contents in a module:

The screenshot above shows that we have referenced a button in the footer attribute, which is rendered at the bottom of the module, wrapped inside a div HTML tag as specified: