DevExpress MVC extensions fully support jQuery AJAX callbacks. This demo shows how to load partial views containing DevExpress MVC extensions within a jQuery ajax callback.
The Menu extension contains three items. When the end-user selects an item from the menu, the OnSelectingMenuItem function is called. This function contains an ajax request, which causes the <div> container to be updated with the rendered DevExpress MVC extension from the partial view.
Ajax requiest settings:
- data - defines the data to be sent on the server. In this demo, the selected menu item name is sent to the server.
- beforeSend - defines a pre-request callback function. In this demo, the pre-request callback function invokes loading panel.
- success - defines a function to be called if the request succeeds. In this demo, the called function hides the loading panel and puts the rendered extension code into the required container.
You can find more available settings here: jQuery.ajax() – jQuery API.
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
The source code files for this demo are installed (by default) in the following directory:
Open CS Solution
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxMultiUseExtensionsDemos