fluidguid
fluidguid

Reputation: 1681

@Html.ActionLink with ko data-bind

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:

https://plus.google.com/photos/105612417165831662125/albums/5847070406315217649?authkey=CPqQ2oGYn46GFQ

Thanks in advance.

Upvotes: 0

Views: 3424

Answers (1)

bdesham
bdesham

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

Related Questions