Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting Started with Knockout.js for .NET Developers
  • Table Of Contents Toc
  • Feedback & Rating feedback
Getting Started with Knockout.js for .NET Developers

Getting Started with Knockout.js for .NET Developers

By : Andrey Ankshin
4.2 (9)
close
close
Getting Started with Knockout.js for .NET Developers

Getting Started with Knockout.js for .NET Developers

4.2 (9)
By: Andrey Ankshin

Overview of this book

This book is intended for .NET developers who want to use the MVVM design pattern to create powerful client-side JavaScript linked to server-side C# logic. Basic experience with ASP.NET, Razor, and creating web applications is needed.
Table of Contents (9 chapters)
close
close
8
Index

Multiple view models


Another important task in real projects is combining several views on the same page. In other words, you separated Models and their corresponding separated Views (in different files), but you want to display all Views at the same time. So, let's consider the following example.

The Model will be as follows:

public class BookModel
{
  public string Title { get; set; }
  public string Author { get; set; }
}
public class LibraryModel
{
  public string LibraryName { get; set; }
  public List<BookModel> Books { get; set; }
}
public class ReaderModel
{
  public string FirstName { get; set; }
  public string LastName { get; set; }
  public BookModel FavoriteBook { get; set; }
}
public class MultipleViewModel
{
  public LibraryModel LibraryModel { get; set; }
  public ReaderModel ReaderModel { get; set; }
}

The Controller will be as follows:

public class MultipleViewModelController : KnockoutController
{
  public ActionResult Index()
  {
    var model = new MultipleViewModel...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Getting Started with Knockout.js for .NET Developers
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon