Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8657549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:32:52+00:00 2026-06-12T15:32:52+00:00

I have a knockout template (using koExternaltemplateEngine_all.js) in which I want an edit link

  • 0

I have a knockout template (using koExternaltemplateEngine_all.js) in which I want an edit link that will direct to a controller/action. I quite like what knockout provides for me in terms of MVVM, but uncertain if I’m trying to mix apples and oranges by specifying an action link in a knockout view. I’d like to knock what is the best way to accomplish this?

Thanks in advance!

<p>
  <b><span data-bind='text: Title'></span></b>
  <span data-bind='text: ArticleDate'></span>
</p>
<span data-bind='text: BodyText'></span>

Something like

<a data-bind="attr: { 'href': '@Url.Action("Details" .. ?

The Model

    public class SecureModel
    {
       public SecureModel()
       {

       }

       private List<Article> _articles;

       public List<Article> Announcements
       {
          get
          {
              return _articles;
          }
          set
          {
              _articles = value;
          }
       }
    }

View

    @model UI.Models.SecureModel
    @{
      ViewBag.Title = "Announcements";
    }
    var viewModel = {

    isEditable: ko.observable(false),
    articles: ko.mapping.fromJS([]),
    loadInitialData: function () {
        ko.mapping.fromJS(serverData, dataMappingOptions, viewModel.articles);
    },
    loadUpdatedData: function () {
        ko.mapping.fromJS(serverData, dataMappingOptions, viewModel.articles);
    }
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:32:54+00:00Added an answer on June 12, 2026 at 3:32 pm

    If I’m reading your code right then you have already scoped to the Article since your first KO data-bind samples show Title, ArticleDate, etc…. It’s a little hard to tell since you don’t show what Article has for properties…

    If this is the case you should be able to do something like this:

    <a data-bind="attr: { 'href': '@Url.Action("Details", "ControllerName", new {actionParameterName=ArticleModelKeyFieldName}">Details</a>
    

    Where actionParameterName is the name of the parameter in your action and ArticleModelKeyFieldName is the key field on your Articles Model.

    So if you had an action like:

    public ActionResult Details(int articleId)
    {
    ....
    }
    

    Then actionParameterName would be articleId.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Knockout with jQuery and jQuery templates. Assume that I have a template
I have the following table template that is rendered through knockout: <table class=gv data-bind=visible:
I have a Knockout observable array that I wish to edit from within Javascript
I have created a form with knockout that will allow the ability to give
I have a page that requires jQuery.tmpl, but I want to use native knockout
I have a knockout model that is feeding my page and on a save
I am using knockout and have an array Properties and each Property can have
Hello I have the following code which uses knockout.js, var allJobberDetailsArray = []; getAllJobberDetailsArray();
I am trying to setup generic Knockout templates that can be toggled between edit
I'm working with a new application at work that we're building out using Knockout.js

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.