Ajax Call

In this lesson we learn about making an Ajax call using module buttons. M# provides this action to simplify the Ajax calling, when required on a button click. “Ajax Call” is a button action which provides attributes to customise the call and call-back functionality.

Ajax call action allows developers to write server side and you can also supply parameters. A separate attribute is available to implement call back handler. The screenshot below shows the Ajax call default implementation in M#.

M# generates a method “ProcessAjaxCall” in the backend, which receives an argument of type string[]. This argument is used to retrieve the parameter supplied in M# (shown in above picture). Any code provided for the server side handler of the Ajax Call is executed inside this method, as shown below

The client callback handler is generated on the frontend, which executes the client side code provided by developer.