Tagged Questions
3
votes
6answers
5k views
Best practice on passing Mvc Model to KnockoutJS
I googled around on how to pass mvc model to knockoutjs and it seems there are two ways:
Using @Html.Raw(Json.Encode(Model))
Using $.get or $.ajax
Which of the ways is a best practice of passing ...
3
votes
2answers
1k views
ValidateAntiForgeryToken with SPA architecture
I am trying to set Register and Login for Hot Towel SPA applicantion. I have created SimpleMembershipFilters and ValidateHttpAntiForgeryTokenAttribute based on the asp.net single page application ...
3
votes
1answer
742 views
Knockout binding in MVC4 partial views
In short, what I believe I'm after is a way to provide scope/context to knockout bindings/javascript objects in MVC4 partial views, so that I can reuse the same partial without having them interfere ...
1
vote
1answer
2k views
Upshot MVC 4 handling of Date, knockout bindings
How does upshot.js handles DateTime objects?
As it seems its just creating "normal" strings and not creating a real JS date object.
All the problems related to JSON date formatting and MVC are ...
5
votes
1answer
1k views
MVC4 - Is there a way to route the root to a “normal” unprocessed html page?
I have an MVC4 app, but I'm primarily using it for the WebAPI parts. I want to have a "plain old HTML" file sent back to the user (which will then use KnockoutJS or KendoUI to pull JSON from the ...
5
votes
1answer
673 views
Validation in Breeze and Knockout
I've recently added Breeze to a project using Knockout and ASP.NET MVC4. I really like Breeze and it saves a lot of coding.
I have used Knockout validation and like how it validates a property ...
3
votes
2answers
1k views
How to extend knockout observables to read default value from binding?
I have finally found the time to start learning KnockoutJS while building a new MVC4 application. I am trying to figure out the best way to initialize an observable value from a default value that is ...
2
votes
1answer
79 views
Dynamically accessing properties of knockoutjs observable array
I am using the below code for handling sort functionality. It is working for me. But is there any way to make the code as common and so i can use it whenever needed.
<span class="sorting" ...
1
vote
3answers
619 views
jquery mobile and Durandal
Please anyone suggest me, it's good idea to use Durandal and JuqueryMobile for mobile based application (Browser). I am planning to develop an application using Durandal, Jquerymobile, MVC4, ...
1
vote
2answers
1k views
Asp.net mvc4, knockout js, knockout ViewModel loads for all views?
I am new to asp.net mvc4 and knockoutjs and need help understanding how the views work.
I have a _Layout.vbhtml in Shared folder and it's the "master" page for all pages in the project.
I have ...
1
vote
1answer
238 views
JSON date not posting to controller (KnockoutJS/JQuery, MVC 4 RC)
I have a KnockoutJS viewmodel which I'm posting to an MVC controller as a JSON object like so:
var dataObj = ko.toJSON(viewModel);
$.post(postURL, dataObj, callBackFunc);
The model itself has a ...
0
votes
1answer
104 views
Edit one row in a list of records?
I have a list of records, e.g. addresses. It's displayed using the following html5/knockout code.
<section id="lists" data-bind="foreach: addresses, visible: addresses().length > 0">
...
0
votes
0answers
335 views
knockout issue, jquery mobile - control not re-rendering (asp.net mvc4)
I have a viewmodel that uses $.getJSON to retrieve data from the server for three different objects, GrowerInfo, BranchInfo and GrowerList. I am rendering the data in two link-buttons (GrowerInfo, ...
0
votes
0answers
374 views
knockout - data-bind not working except for the first time
Part of my ViewModel is:
var MyGrower = function (data) {
this.Id = ko.observable(data.GrowerId);
this.name = ko.observable(data.GrowerName);
};
self.growers = ...