i have an observable array in my viewmodel “IdOfInvitedSocialCompaigns” , this property contain array of id , and i want to create link like this :
@Html.ActionLink("Compaign","Confirmation", new {socialbuzzCompaignId = id})
how can i built link like this with knockoutjs, here is a part of viewmodel :
function DashboardViewModel() {
var self = this;
self.IdOfInvitedSocialCompaigns = ko.observableArray([]);
}
You might be able to build the partially Razor generated URL directly into your binding markup if you get the escaping right, but it’d be messy. I’d probably define a base URL property on DashboardViewModel which gets populated by the page on DOM ready like so:
and then have a function which gets a specific URL:
bound like so: