Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Call Methods

To call methods, use JavaScript API. For example, you have a Popup control:

@(Html.DevExtreme().Popup()
    .ID("popup")
)

This control appears on the page after its show() method is called. The code below demonstrates how to call this method.

$("#popup").dxPopup("show");

Note

To access a client widget instance in JavaScript, add the dx prefix to the widget name, for example, dxPopup.

You can put the provided code in any JavaScript constructions and execute it, for example, when a user clicks a button…

@* ... *@
@(Html.DevExtreme().Button()
    .OnClick("showPopup")
)
<script>
    function showPopup() {
        $("#popup").dxPopup("show");
    }
</script>

… or once your page is ready.

// ...
<script>
    $(showPopup);

    function showPopup() {
        $("#popup").dxPopup("show");
    }
</script>

If the called method accepts arguments, pass them after the method’s name. For example, the following code calls the Popup control’s toggle(showing) method with true as the argument.

$("#popup").dxPopup("toggle", true);

For more information, see DevExtreme API Reference.