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.

273 questions
2
votes
3 answers

How to pass value from one view model to another viewmodel in knockout js?

i have two view models and i want to pass value from one view model to another viewmodel. i have two viewmodels and two div i want to display another div on click of button which is present in div 1. here is html code
user2142786
  • 1,484
  • 9
  • 41
  • 74
2
votes
1 answer

Why does MVC 5 SPA site "Login" page not work with saved passwords?

I have an MVC 5 Single Page Application and the canned "Log in" page will not work with saved passwords - the validation code seems to think the fields are empty even when they're not: This effectively prevents the user from logging in. I've…
Nobody Special
  • 1,255
  • 1
  • 10
  • 14
2
votes
2 answers

knockout binding not work for second time

I use knockout in MVC c# project. I have shopping cart button on my web page and use below code to load shopping cart as modal dialog. This code works for first time but when I click again on shopping card it's not work. I know this problem is…
Hadi Sharifi
  • 1,497
  • 5
  • 18
  • 28
2
votes
1 answer

Image with href binding won't work

I have this and it works (It show link with text and icon): Date
Milos
  • 647
  • 6
  • 21
2
votes
2 answers

Knockout.js: populate drop-down value with data in edit mode

I am using knockout.js. I am having a situation like, Search page will produce search results .with edit icon and user clicked on edit icon and navigate to edit page. On Edit page,I have drop down which should be populate with value from the…
AMDI
  • 895
  • 2
  • 17
  • 40
2
votes
1 answer

Binding a datepicker max date in future based on checkbox in Knockout.js

I have a datepicker whose max selectable date is six months in the future. And if I select a checkbox, the max selectable date can be any time in the future. I'm trying to do this with Knockout.js. This would be my date picker input options:
2
votes
2 answers

how to use mvc4 model value in knockout viewmodel js

I am using Knockout with ASP.NET MVC here is my View which is populated by MVC controller HTML Controller public actionresult xyz(){ var…
Ancient
  • 3,007
  • 14
  • 55
  • 104
2
votes
1 answer

knockoutmvc - unable to parse bindings

I have an ASP.NET MVC site and I am trying to get knockout-mvc working with it. I have created a View Model in the C# code called Refund that contains among other things a Voucher called Vouchertype and a List called Countries. Voucher has…
Neil
  • 2,659
  • 7
  • 35
  • 57
2
votes
1 answer

Multiple Compute fields in KnockoutMVC Sub-Models

KnockoutMVC 2.10, MVC 4.0, C# 5. Working from one of the examples on the main site (Computed fields in Sub Models). I am having a problem and wondered if anyone could help. In the code below, the computed Message field updates fine, based on two…
Rob L
  • 2,124
  • 3
  • 22
  • 50
2
votes
3 answers

Knockout js - && in if condition and containerless binding

I am displaying a list of items and if the items are not available I have to display a default message. Now, I have to check whether the object has been created and then check the object has the list in it. So now, I am doing the below and it…
Ashwin
  • 262
  • 2
  • 5
  • 13
2
votes
1 answer

learning the mechanics of knockout.JS

Im using MVC and I am trying to use the introduction tutorials on http://learn.knockoutjs.com/#/?tutorial=intro I would like to implement them in Visual studio though. Im not exactly sure how to do this... So I create a JS file: // This is a simple…
John
  • 3,965
  • 21
  • 77
  • 163
2
votes
1 answer

How to apply knockout validation to properties every item List passed by MVC?

The following is a view models in ASP.NET MVC: public class Email { public string Selected { get; set; } public string Name { get; set; } } public class User { public string UserName { get; set; } public IList Emails { get; set;…
2
votes
1 answer

Knockout validation error in Internet Explorer?

In my razor view that using knockout and supposedly knockout validation I add the following line (to actually start using ko validation): When I…
2
votes
1 answer

how to detect a mouse click, enter key or tabbed item on drop down list box in knockout

What is the best way to get the selected item value from a dropdown list box when the user does one of the following; hits the tab key on the item, presses the enter key or mouse clicks the item. Do I have to create a javascript event handler…
LRP
  • 283
  • 1
  • 3
  • 5
1 2
3
18 19