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.

Default Structure of Pages and Modules

In this lesson we will take a look on the structure of pages and modules developed in M#.


Pages in M# mainly host modules and some initialization code but do not contain complex code. M# generates simple ASP.NET pages. Each page inherits a master page and registers modules on it.

The above screenshot is of a page “Profile”, which is subpage of “Employee” and inherits “Front end” master page. Details on creating pages and subpages is available in tutorial Entity, Page, Module in chapter 1. Master pages are explained further in tutorials Master page and Modal VS Standard in chapter 6

The screenshot shows three different sections, which are used to customise the page functionality and design. Modules section is used to host modules, which are generated by M# according to the sequence they are hosted unless given a layout attribute. For Details on hosting modules and page layout, please read tutorial Module Hosting in chapter 6.

The Start-up section is used to write custom code for page initialization. This section is very important to manipulate hosted modules and page level functionality. M# generates the custom code provided in this section in the “OnInit” event. Start-up lesson in chapter 6 explains this section in more detail.

Settings is used to apply page level settings, to display menus or to control page design. (For details on setting up page setting, please read Page Settings in chapter 13 and Page Settings in chapter 6).

M# also allows customising page level attributes by exposing attributes on page level e.g. if you want to change the browser title or any custom page tag attribute like page event validation.


Modules encapsulate the actual operation of any page in M#. We develop modules in M# which are hosted on pages and expose forms, lists, menus or simple data views (Basic information on Modules is available in lesson Entity, Page, Module in chapter 1).

M# modules, except menus, require an entity type to be given in order to develop a module. These modules enlist all the properties of the entity, in a section called “Elements.” These elements are responsible to display, capture or hold information about a particular business object, which are rendered on the pages.

All modules have specific layout to display data or input controls. Modules contents are wrapped inside one container HTML element and then each module “Element” is placed in the container, wrapped inside another wrapper, which groups each module element. Module markup and styling details are available in lesson Css and Styling in chapter 7 and Module Markup in chapter 12.

M# provides a “Buttons” section for each module. This section is used to add buttons on each module as required. You can customize the functionality and layout of each button using attributes provide by M# explained in lesson Module Buttons in chapter 7 and Customisation Layout Button in chapter 12.

Code section is used to implement custom code required for each module including methods, JavaScript, properties, initialization etc. Please read Module Custom Code and Module Properties in chapter 7 for more details on module code customization.

M# allows developers to reference existing modules in M# for rendering or manipulating the functionality. We often need to display a form on multiple pages e.g. login, payment etc. which can be done by referencing. Referencing Other Modules tutorial discusses this part in more detail.

“Update effects” section is used to define the visual effects during page post backs. M# defines fading, background colour change and text based options which can be used to customise the postback affect.

Modules have mainly thee parts, Head, Body and Footer. You can customize the header and footer of a module by specifying static and dynamic contents as explained separately in tutorials Page Header in chapter 7 and Module Header and Footer in chapter 12.

The body section of a module is customised using “Elements” section in all views except menus. Menu Modules provide “Item” section to define the navigation explained in chapter 10.