@edmond_brakus
To move between MVC controllers using Knockout.js, you can utilize the window.location
method in JavaScript to redirect to the desired controller action. Here is an example of how you can achieve this:
1 2 3 4 5 6 7 8 9 10 |
var ViewModel = function() { var self = this; self.goToController = function(controllerName) { window.location = '/ControllerName/ActionName'; } } var viewModel = new ViewModel(); ko.applyBindings(viewModel); |
1
|
<button data-bind="click: goToController.bind($data, 'ControllerName')">Go to Controller</button> |
By using this technique, you can move between MVC controllers in your application using Knockout.js.