We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to render our controls via ajax partialview in unobtrusive true mode?

Platform: ASP.NET MVC |
Control: Dialog |
Published Date: July 29, 2016 |
Last Revised Date: May 8, 2019

Description

While rendering our Syncfusion controls inside the partialview which is called through AJAX call in UnobtrusiveJavaScriptEnable true mode. Please follow the below steps,

  1. We have to set UnobtrusiveJavaScriptEnabled as true in the web.config page

<configuration>
             <appSettings>
              <add key="webpages:Version" value="3.0.0.0" />
      <add key="webpages:Enabled" value="false" />
     <add key="ClientValidationEnabled" value="true" />
     <add key="UnobtrusiveJavaScriptEnabled" value="true" />
      <add key="vs:EnableBrowserLink" value="false" />
   </appSettings>
</configuration>
 

 

  1. You need to refer the dependent Script and CSS files in the _Layout.cshtml.

[HTML]

<link href="@Url.Content("~/Content/ej/web/Default-theme/ej.widgets.all.min.css")" rel="stylesheet" />
   <script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"></script>
<script src="@Url.Content("~/Scripts/jsrender.min.js")"></script>
  <script src="@Url.Content("~/Scripts/jquery.easing.1.3.min.js")"></script>
      <script src="@Url.Content("~/Scripts/jquery.globalize.min.js")"></script>
     <script src="@Url.Content("~/Scripts/ej/ej.web.all.js")"></script>
     <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>
 

 

 

  1. Then initialize our control by using the “ej.widget.init” method in the AJAX success function.

[HTML]

 
<div id="updatePartialview"></div>
 

 

[JavaScript]            

          <script>
            function onclick() {
           $.ajax({
                url: '/Dialog/Buttonview',
                success: onSuccess
});
      }
          function onSuccess(result) {
               $("#updatePartialview").html(result); 
               ej.widget.init($("#updatePartialview"));
          }
</script>
 

 

 

Sample

 

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon