Skip to content

Use the jQuery.ajax function to load a Grid View on a callback.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/mvc-gridview-jqueryajax-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

DevExpressExampleBotDevExpressExampleBot
DevExpressExampleBot
and
DevExpressExampleBot
Mar 19, 2025
8412afd · Mar 19, 2025

History

45 Commits
Mar 3, 2025
Mar 19, 2025
Mar 19, 2025
Jun 19, 2023
Apr 23, 2018
Apr 23, 2018
Apr 23, 2018
Aug 29, 2024
Apr 23, 2018

Repository files navigation

Grid View for APS.NET MVC - How to use the jQuery.ajax function with DevExpress MVC extensions

This example demonstrates how to use the jQuery.ajax function to load the GridView extension on a callback.

A sample grid

In this example, we handle a button's Click event to call the $.ajax() function. The function sends an AJAX (asynchronous HTTP) request to the GridViewPartial action and renders the action result (GridViewPartial.cshtml) to the div container.

<script type="text/javascript">
    function OnClick(s, e) {
        $.ajax({
            type: "POST",
            url: "@Url.Action("GridViewPartial")",
            success: function(response) {
                $("#container").html(response);
            }
        });
    }
</script>
@Html.DevExpress().Button(settings => {
    settings.Name = "MyButton";
    settings.Text = "Click Me!!!";
    settings.ClientSideEvents.Click = "OnClick";
}).GetHtml()

Files to Look At

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)