Always will be ready notify the world about expectations as easy as possible: job change page
Power of Knockout.js for ASP.NET MVC

Power of Knockout.js for ASP.NET MVC

Добавлено: 17 сентября 2018 г.
Просмотров: 455

Knockout MVC

Brief Overview

Knockout.js - is a popular JavaScript library that allows easy creation of feature-rich applications based on Model-View-View Model (MVVM) pattern: user interface can be bound to a separate existing data model. And any change of the model will result in dynamic refresh of the interface.

Knockout MVC is a library for ASP.NET MVC3/MVC4 , that is a wrapper for Knockout.js, that helps to move entire business logic to the server side: the complete JavaScript code necessary on the client side will be generated automatically based on the described C# (or VB.NET) model. Binding of the page interface to business model is done MVVM-style with the help of C#/VB.NET expressions (not separate properties, but expressions over them that will be translated to JavaScript code) using IntelliSense. If complex operations should be done to the model, it is possible to address to any model method on the server using one short string (ajax query will be automatically generated; and when the client will get the updated model, the whole interface will automatically refresh).

Generated JavaScript code is based on Knockout.js and that is why it works under any browser (even IE 6). Thus, describing the whole business logic on the server in a single instance we get an ability to create fully-featured cross-browser client Web application without writing a single JavaScript code!


Today, any serious application rarely uses only one library. And very often the problem of libraries compatibility arises. Knockout MVC lacks this disadvantage. It is always possible to add your own native Knockout-code to the existing C# code (example). And Knockout itself greatly mates with any other libraries. Knockout.js doesn’t depend on any other libraries; however its core hides various useful tools for work with jQuery (that start working when it is connected). It is possible to use other libraries (for example, Prototype), but is you use jQuery (as many other developers) you can use any jQuery plug-ins (for example, jQuery.Validation, example). You can use RequireJs (example) to load big scripts.

Besides compatibility with third-party libraries, it’s worth to mention browser compatibility: Knockout MVC is completely cross-browser (since it is based on Knockout.js) and works fine in IE 6+, Firefox 2+, Opera 10+, Chrome, Safari.

Написать сообщение

© 1999–2024 WebDynamics
1980–... Sergey Drozdov
Area of interests: .NET Framework | .NET Core | C# | ASP.NET | Windows Forms | WPF | HTML5 | CSS3 | jQuery | AJAX | Angular | React | MS SQL Server | Transact-SQL | ADO.NET | Entity Framework | IIS | OOP | OOA | OOD | WCF | WPF | MSMQ | MVC | MVP | MVVM | Design Patterns | Enterprise Architecture | Scrum | Kanban