Learn More





DNN Community Blog

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.

Let’s Build A Module-#5 MVVM and Data Binding with Knockout

In part 5, we talk about client-side databinding, and utilizing the MVVM style of development on the client with Knockout.js.

NOTICE: This is a work in progress. The template is not complete, during the course of this series we will be enhancing and tweaking the template as we build a new DotNetNuke module using these advanced technologies. The template is being released as-is so that you can download it and follow along, or participate by helping with the development. You can certainly use the template in it’s current state to build a DotNetNuke module, however, you will have to do some things manually for now until the template is complete. If you have any question at all, do not hesitate to contact me directly

The “Let’s Build a Module” series

1. Project Introduction
2. Downloading, Installing and Using the Template
3. Output Formatting
4. Data Access with Entity Framework and a WCF Data Service
5. Client side Data Binding with Knockout.js
6. Mobile Development
7. Security
8. Testing
9. Packaging and Distribution

5. Data-Binding with Knockout.js

There’s a big push these days to javscript based libraries and frameworks, moving the processing down to the client side.  The goal is to provide users with a more responsive UI, better performance by keeping the processes that need to run on the server, on the server, and move the stuff that doesn’t need to be on the server down to the client.  This elimiates a LOT of uneccessary post-backs and server round-trips.

Tempate Update

IMPORTANT NOTE: As I’ve mentioned many times throughout this series, I am developing a Project Template that you can use to build DotNetNuke modules using the technologies being demonstrated. As the series prgresses, I will be tweaking and updating the template based on feedback from you, and through experience I’m gaining by using the template to build this series.

I recently updated the template, which you can download from

Updates include:

- replaced the markup loading the javascript files and css files with the DotNetNuke ClientResourceManagement services. This will optimize the scripts and stylesheets being downloaded as well as make sure resources are not downloaded multiple times (very important when you have multiple modules on a page all using Knockout.js)

- Added the datajs open source libary



There are a lot of MVVM tutorials on the web, so I won’t go into too much detail, but a quick overview should help those unfamiliar.

MVVM stands for “Model-View-View Model”. In essence, it breaks down responsibilities into three components.

The “Model” represents your Business Objects.  These are objects that have one or more ‘properties’, and they represent an ‘object-view’ of your data.

The “View” represents the UI. In our module the View will be the HTML markup to format and display our business objects and other status text to the user.

Finally, the “View Model” sits between the Model and the View.  The View Model is responsible for retrieving any required data from a data store, or initializing our business objects in whatever way is neccessary., then make that data available to our View through data-binding, using a data-binding engine (in our case, Knockout.js)

Demonstration Video

The following videos show how to use the Knockout.js library, datajs library and the WCF Data Service and Entity Framework we built in Part 4 to get the data from the database to the screen.

The Video has been broken up into 2 parts (10-minute youtube limit)

Part 1 of 2–Client-Side Data-Binding with Knockout.js


Part 2 of 2–Client-Side Data-Binding with Knockout.js


Ainsof So'o
I noticed that you pass the base _editURL path from the code behind ( and then attach your parameters using the /Id/ + ID javascript (

This could easily break if a site is set up to use the old style URLs (ie Id= [ID]). What are some strategies to overcome this?
Ainsof So'o Sunday, June 07, 2015 7:11 PM (link)

Comment Form

Only registered users may post comments.


2sic Daniel Mettler (124)
Aderson Oliveira (15)
Alec Whittington (11)
Alex Shirley (10)
Andrew Nurse (30)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (22)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (203)
Chris Paterra (55)
Clinton Patterson (28)
Cuong Dang (21)
Daniel Bartholomew (2)
Dave Buckner (2)
David Poindexter (3)
David Rodriguez (2)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (74)
Geoff Barlow (6)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (270)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matthias Schlomann (15)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Mike Horton (19)
Mitchel Sellers (28)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Peter Donker (52)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott S (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Timo Breumelhof (24)
Tony Henrich (3)
Torsten Weggen (2)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (37)
Will Strohl (163)
William Severance (5)
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?