Questions tagged [knockout-mvc]

Knockout MVC is a web framework for ASP.NET MVC based on the popular Knockout.js JavaScript library. It allows easy creation of feature-rich applications based on Model-View-View Model (MVVM) pattern.

Knockout MVC is a web framework for ASP.NET MVC based on the popular Knockout.js JavaScript library. It follows the Model-View-View Model (MVVM) pattern, in which the user interface can be bound to a separate existing data model such that any change of the model will automatically update of interface.

Knockout MVC follows the concepts of the Knockout.js library, but uses server-side .NET classes as models instead of JavaScript as used by plain Knockout.js. Knockout MVC allows the creation of Rich Applications without the need to write JavaScript by dynamically generating some JavaScript on the server based on C#/VB.net code, and by using more server-side processing.

262 questions
55
votes
12 answers

Is there a reason I would use Knockout MVC instead of Knockout JS?

Another user suggested Knockout MVC to handle some AJAX posting issues. I read a little on it and I see it is a wrapper around Knockout JS. So I wonder what are the real differences between the two? Should I bother with Knockout JS since Knockout…
dotnetN00b
  • 4,745
  • 11
  • 58
  • 90
18
votes
1 answer

KnockOut.js With Asp.net mvc

Just started learning the new asp.net mvc4 SPA template , noticed that knockout is being used , so give me reference to any book / Video which describes asp.net mvc with knockout.js from scratch .
Ancient
  • 2,717
  • 10
  • 45
  • 99
13
votes
2 answers

How to bind knockoutjs value to MVC Action Link (id)

I have table view binds with knockoutjs model. …
yohan.jayarathna
  • 3,263
  • 13
  • 53
  • 73
9
votes
2 answers

Mapping hierarchical JSON to TypeScript-KnockoutJS typed Object

Let's start with a thanks in advance :) OK, So I'm trying to load/map hierarchical TypeScript/KnockoutJS typed classes from matching JSON data using the knockout.mapping plugin, the hierarchy can be to the Nth degree. I know I can do the following…
8
votes
1 answer

Durandal/Knockout. Update other view/viewmodel

Durandal has a base view called shell. I've added a searchbox on it to allow admin/quality assurance users to mimic any system user. On the button click I want to be able to update the view of whichever view is currently displayed. Shell (Blue) …
Rohan Büchner
  • 5,052
  • 4
  • 57
  • 98
8
votes
2 answers

How can I bind a ko.observableArray of strings?

I'm trying to bind a ko.observableArray of strings to a template, but I'm unable to get the template to pick up changes in the strings inside the array. If I bind a set of objects instead of a set of strings, I get updates to the JSON, but they…
slipheed
  • 7,002
  • 3
  • 23
  • 36
7
votes
2 answers

Undo change on cancel button

I am trying to cancel the changes done during my page edit. But whenever I click on cancel, the updated changes are reflected. How to revert the changes on click of cancel button. Any help on this will be really helpful since I am new to…
user4324324
  • 523
  • 2
  • 7
  • 19
7
votes
1 answer

Set table columns dynamically from ko.observableArray

I am trying to output a table of data based on a ko.observableArray where the columns that are returned are not pre-determined. A sample of an item from my observableArray self.userData()[0] would be: Object { RowNum: 1, ID: "123",…
Tanner
  • 20,318
  • 9
  • 56
  • 73
7
votes
1 answer

Knockout Js Dictionary Display MVC

I am stuck on something quite basic I believe, therefore I require some expertise to help me achieve this task. I have a dictionary which takes an integer and string as values in order to store a list of results (which I will show below). My View…
6
votes
4 answers

How can I bind an editable ko.observableArray of observable strings?

This is a follow-up to How can I bind a ko.observableArray of strings? How can I bind an editable observable array of observable strings to a set of input boxes? I don't want to bind to an array of objects, as my underlying JSON sent from the server…
slipheed
  • 7,002
  • 3
  • 23
  • 36
5
votes
0 answers

Unobtrusive Validation not working in K-Mvc

I am using Knockoutmvc for my project. Following is the code. @using PerpetuumSoft.Knockout @model OpManWeb.ViewModel.Customer.AddressVM @{ var ko = Html.CreateKnockoutContext(); } @{ ViewBag.Title = "Add/Edit Address"; } …
5
votes
1 answer

How to send model property value to controller method in K-MVC using @Ko.Html.Button

I am trying to send value of StockDate to Controller Method. I am getting Null. http://knockoutmvc.com/ParametersToServer as per above link if I pass static value like below.I can get value but when I use Model.Property I always get…
Aditya Raval
  • 582
  • 3
  • 19
5
votes
1 answer

Using Jquery to update an Azure web page

I am trying to build a website in MVC 4.0 and knockoutMVC that uses jQuery to update elements on a page, the website will be run from Azure web, the code I have works fine when I run it locally, however when I upload to azure no updates happen on…
Ben Sharpe
  • 789
  • 1
  • 8
  • 22
5
votes
1 answer

How to calculate total cart value from knockout mvc cart sample

I am trying to get my head around knockout mvc framework. I am looking at the sample of a shopping cart and trying to figure out: How to calculate total cost Where to add client side business rules (such as discounts and vouchers) To calculate…
oleksii
  • 33,544
  • 11
  • 83
  • 149
4
votes
1 answer

KnockoutMVC submit button not working

I am using knockoutmvc to bind controls.(http://knockoutmvc.com/) I am getting following error while clicking on button. Following is my Razor view implementation : @using PerpetuumSoft.Knockout @model OpManWeb.ViewModel.ManageAddressVM @{ var…
Aditya Raval
  • 582
  • 3
  • 19
1
2 3
17 18