javascript - Knockout Ajax only loading sometimes, no errors shown in log -


i have knockout view in mvc application. worked fine until today, of views work, , doesn't.

my ajax:

$(document).ready(function () {         $.ajax({             type: "get",             url:  "@url.action("getview", "omfangs", new { id = viewbag.id})",         }).done(function (data) {             $(data).each(function (index, element) {                 var mappeditem =                     {                         id: ko.observable(element.id),                         overskrift: ko.observable(element.text1),                         addtext: ko.observable(element.addtext),                         antal: ko.observable(element.amount),                         pris: ko.observable(addcommas1(element.price)),                         lejepris: ko.observable(element.rentingprice),                         tilbudid: ko.observable(element.tilbudid),                         produkterid: ko.observable(element.produkterid),                         mode: ko.observable("display")                     };                  viewmodel.lookupcollection.push(mappeditem);             });             ko.applybindings(viewmodel);         });     }); 

and here controllers method:

public actionresult testview(int? id) {     viewbag.produktersid = new selectlist(db.produkters, "id", "beskrivelse");      viewbag.id = id;      return view("testview"); }  [httpget] public actionresult getview(int? id) {      var list = db.omfangs.where(x => x.tilbudid == id).tolist();      viewbag.produktersid = new selectlist(db.produkters, "id", "description");      var newlist = jsonconvert.serializeobject(list,      formatting.none,       new jsonserializersettings()       {           referenceloophandling = referenceloophandling.ignore       });      return content(newlist, "application/json"); } 

i have tried locating error entire day, no succces. if feel information lacking ask, , best provide more. hope find error on this.

after have done testing on ajax found throws exception of type 'system.outofmemoryexception' thrown.


Comments

Popular posts from this blog

javascript - How to bind ViewModel Store to View? -

recursion - Can every recursive algorithm be improved with dynamic programming? -

c - Why does alarm() cause fgets() to stop waiting? -