How to render the 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 about how 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.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!