This is a migrated thread and some comments may be shown as answers.

ASP.NET MVC controls are generating inline javaScript

1 Answer 137 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pero
Top achievements
Rank 1
Pero asked on 20 Mar 2015, 02:21 PM
Hello,

We are using ASP.NET MVC controls, and we have one potential deal breaker.

When we open the HTML source off a rendered page we see the HTML code generated by the Telerik control and immediately below it we see a <script> tag with some javascript for that control. This is very bad for us, and we don't want to have javascript code mixed in the HTML.

Is there an alternative to this issue or it is just how the controls are designed?

Thank you!

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Mar 2015, 07:48 AM
Hi Pero,

Indeed the Kendo UI MVC wrappers output a <script> element with the initialization script. This can be disabled by calling the Deferred() method. However you should later manually call Html.Kendo()().DeferredScripts() otherwise the widgets will remain uninitialized. More information is available here.

Regards,
Atanas Korchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Pero
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or