Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use knockout js binding in asp.net mv4 web application
    primarykey
    data
    text
    <p>Hi guys i have a project that follows the 3 tier architecture, in my web application that uses mvc 4 i am trying to use knockout binding, but however my data is retrieve from my data tier but the UI is not been updated. Below are my code snippet</p> <p>My Model that reside in my data tier which is a separate class library</p> <pre><code>public int SocialProfileId { get; set; } public string Title { get; set; } public string Description { get; set; } public string Url { get; set; } public string ImgUrl { get; set; } </code></pre> <p>My View model in my web project var SocialViewModel = function () { var self = this;</p> <pre><code>self.Title = ko.observable(""); self.SocialLinks = ko.observableArray(); GetSocialLinks(); function GetSocialLinks() { $.ajax({ type: "GET", url: "Ville/SocialLnk", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { self.SocialLinks(data); alert(data[0]); }, error: function (error) { alert(er.status + "&lt;--and--&gt;" + erro.statusText); } }); } } </code></pre> <p>My view showing my binding</p> <pre><code>&lt;ul class="bl-socialLink" data-bind="foreach: SocialLinks"&gt; &lt;li&gt; &lt;p data-bind="text: Title"&gt;&lt;/p&gt; &lt;a data-bind="attr: { title: Title, href: Url}" target="_blank"&gt; &lt;img data-bind="attr: { alt: Title, src: ImgUrl }" /&gt; &lt;/a&gt; &lt;/li&gt; </code></pre> <p>How do i make my UI display the information? Because i cant figure out why my view is not displaying the values. Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload