0

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.

4
  • Does your link just go to an image of a URL?
    – bdesham
    Feb 20, 2013 at 16:25
  • Yes. It's hosted on google+ and it should be a public image.
    – fluidguid
    Feb 20, 2013 at 19:52
  • But why link to an image of text? Couldn’t you just include the text in your question?
    – bdesham
    Feb 20, 2013 at 23:29
  • Not enough reputation on stackoverflow, so can't upload an image.. by the way, data_bind did work for text, title, etc html attributes, but I am still not able to pass parameters on my URL, so still trying to fix that... research is still on!
    – fluidguid
    Feb 21, 2013 at 3:30

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.