@herminia_bruen
To load a partial view in an iframe on an AJAX call, you can follow these steps:
Here is an example using jQuery:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$.ajax({
url: '/url-to-fetch-partial-view',
type: 'GET',
success: function(data) {
var iframe = $('#myiframe')[0].contentWindow.document;
iframe.open();
iframe.write(data);
iframe.close();
},
error: function() {
console.error('Error loading partial view');
}
});
|
Make sure to replace '/url-to-fetch-partial-view' with the actual URL of the server endpoint that returns the partial view content. Also, replace '#myiframe' with the ID of your iframe element in your main view.
By following these steps, you should be able to load a partial view in an iframe on an AJAX call.