Reputation: 1681
First, is it possible to use @Html.ActionLink
with knockout binding?
If yes, how would I write that?
This is what I need:
@Html.ActionLink( [I want display QuestionID() - a ko view model property] , "Question [controller action name]", "Project [controller name]", new { project = [here should be ProjectID() - a ko view model property] id = [here should be QuestionID() - a ko view model property] }, new Dictionary<string, object> { { "data-bind", "title: 'View detailed question page'" } }))
In simple words, it should look like below when it renders:
Thanks in advance.
Upvotes: 0
Views: 3424
Reputation: 16089
You can of course include data-bind
attributes in an ActionLink; look at this question and its answers for how to do that. But keep in mind that Knockout is purely client-side, and so you'll need to make some kind of AJAX request when you want Knockout to talk to MVC.
Upvotes: 1