Skip to main content

Posts

Showing posts from September, 2017

Making a simple modular single paged website using ASP .Net MVC and knockout.js

This post will be about how to make a simple website that supports multiple modules which are displayed in a single page. By default unlike a lot of other javascript frameworks, knockout.js doesn't really support modules. But fortunately we can implement this functionality using knockout.js itself. We are also going to use bootstrap because it already has builtin support for tabs and other useful features. The structure of the website will be based on tabs. On the left of the tab header bar we will have a menu from which we can select a module to open just by clicking on it. Once we open a module, a tab header will appear up in the tab header bar with the name of the module. And down in the tab content pane, the content of the current tab will appear. Bellow we can see a sketch of the website: We will have a javascript object type which will hold the name, id and functions to load and unload a module from the module tab content area. It looks like this: