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.

Customising Layout: After and Before control

We often need to render buttons or other controls just after or before any existing control of the pages, in this lesson we will learn how we can achieve this in M#.

Note: The layout customisation using after and before attribute can only be done in Form Modules.

Customizing Layout After

M# provides two attributes to customize the layout after any form element’s input control or its container. You can specify HTML markup or reference module buttons using those attributes.

After Control

Markup specified in this attributes on any element is rendered just after the input control e.g. if we want to show an asterisk (*) just after a control we can use this attribute as shown in below screenshot

After Control Container

This attribute is used to customize the layout after the wrapper HTML element of the input control. M# wraps the input control inside a div tag having “input” css class. The markup specified is rendered just after this “div” tag. Below screenshots show that we have referenced a module button in this attribute, which is rendered just after the input control wrapper.

Customizing Layout Before

M# provides two attributes to customize the layout before input control and its label. You can specify HTML markup or reference module buttons using these attributes.

Before Control

This attribute is used to customize the layout just before the input control. M# generates the specified code above the input control.

Before Label

Markup specified in this attribute is rendered before the label of the input control on a form module. M# wraps label text inside div tag having “label” css class. The markup specified using this attribute is generated before the label wrapper.