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 Buttons

In this lesson we will learn about module buttons. M# provides a separate section in each type of module to add buttons. These buttons can be used to redirect to other pages or can be used to implement other actions as required.

The screenshot above shows the section used to add a button. We will add a button in the module and then will discuss the properties of it. In order to add a button, please follow the following steps:

• Click inside the “Buttons” Section.

• Write the text for the button (M# converts the provided text into button name using standard practice e,g, View details will becomes btnViewDetails ).

• Hit “Enter”, M# will add the button with some default properties

The screenshots above show that M# creates an ASP.NET button with the given text and with a few extra properties, which are explained below (For markup customisation, please read lesson Customising Layout Button in chapter 12).

Confirmation Text

This property is used to display a JavaScript confirmation box to the end user before executing actions specified for the respective button. You can define plain or dynamic text contents.

M# adds “OnClientClick” attribute on the created button in generated code to show this confirmation message.

Css Class

Css class property is used to apply css classes on the button

Name

Name property is used to define the id of the ASP.NET button, which is access in code behind. The value provided in this property is prefixed with “btn” to follow the standard naming conversion. M# also throws a warning if a non-standard name is provided:

Style

This is a very important property. It defines the type of the button i.e. Image, text or link button. M# changes the button-mark-up as selected. The style of button also limits the use of some properties e.g. for Image button you cannot specify a dynamic text value.

• Button

This option is selected by default and M# generates the ASP.NET simple text button as shown in previous screenshots.

• Image

This option converts the mark-up to ASP.NET image button. The “Text” property is used in “AlternateText” attribute. M# adds two attributes “ImageUrl” and “HoverImageUrl” on the image button which can also be defined in separate properties and are discusses later in this lesson.

• Link

This option converts the ASP.NET button to an ASP.NET link button

Causes Validation

This option specifies whether to validate the form before performing an actions specified. This property is associated to the ASP.NET “CausesValidation” attribute and “true” is the default vale in M#.

Control Attribute

This is very useful property and allows you add any custom or ASP.NET button attributes which cannot be specified using M# button properties.

Image Url & Hover Image Url

These properties are used to specify the ASP.NET “Hoverbutton” image and hover image urls.

Is Default

This property is used to define the default button of the module and will cause the control to be fired if user hits enter.

ShortKey, Tooltip, Width

These properties are very common properties and are used to define the Short key, hover text and width of a button respectively.

Visibility

M# provides many properties to manage visibility of a button ranging from strand rules to query string and roles as shown in the screenshot below:

Workflow Update Panel Compatible

Specifies, whether the actions given for a button are compatible with AJAX and UpdatePanel control. By default, M# will try to guess if the action is compatible with UpdatePanel. In certain scenarios a page/function doesn't work correctly inside an UpdatePanel. If M# gets it wrong and you want to fix it you can change it here.

Workflow Transaction

This property is used to specify whether the server side actions of the button execute in a transaction.