Let suppose we have a dialog with some settings, then on dialog button "OK" the settings are sent to a controller function via AJAX call. This call either result a downloadable file, or an error described in a (partial) html source code. In latter case this error message must be inserted into the dialog.
$.ajax( {
url: url,
data: dialogFormData,
success: function(data) { ???? }
});
How to handle this situation? How to handle the ajax response to process the result? Any idea?