How to render partial view content while unobtrusive mode is enabled in ASP.NET MVC?
Description
There is no need to refer ej.unobtrusive.min.js file in every partial view page to render Syncfusion components while UnobtrusiveJavaScriptEnabled set as true in ASP.NET MVC.
Solution
When the UnobtrusiveJavaScriptEnabled is set as true in the web.config page then the control must be initialized by using the “ej.widget.init” method in the AJAX success function instead by referring “ej.unobtrusive.min.js” script file on every partial view page. Please refer to the below code:
JavaScript
function click() { $.ajax({ url: '/Home/ToolsPartial', success: onSuccess }); } function onSuccess(result) { $("#updatePartialview").html(result); ej.widget.init($("#updatePartialview")); }
Please find the sample from the following location: Sample
Conclusion
I hope you enjoyed learning on how to render the partial view content while unobtrusive mode is enabled.
You can refer to our ASP.NET MVC feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET MVC example to understand how to create and manipulate data.