Skip to content
Loading
asp.net core get additional info with json and jquery   
+2
  • Marius Vasile
    Thank you Kiran, I tried that, still have the same error, see below
     
     
    +2
  • Kiran Mohanty
    I guess assert details html needs to be cleared before appending any data . Here is the code.
    1. $(function () {    
    2.     $("#Asset").on("change", function () {    
    3.         var categoryId = $(this).val();    
    4.         $("#Equipment").empty();    
    5.         $("#AssetName").empty();    
    6.         $("#AssetManufacturer").empty();    
    7.         $("#Equipment").append("--Select Equipment--");    
    8.         $.getJSON(`?handler=Equipment&id=${categoryId}`, (data) => {    
    9.             $.each(data, function (i, item) {    
    10.                 $("#Equipment").append(`"${item.value}"> ${item.text}`);    
    11.             });    
    12.             $('#Equipment').selectpicker({ liveSearch: true });    
    13.         });    
    14.         $.getJSON(`?handler=AssetDetails&id =${categoryId}`, (data) => {    
    15.             $("#AssetName").append("asset.AssetName");    
    16.             $("#AssetManufacturer").append("asset.AssetManufacturer");    
    17.         });    
    18.     });    
    19. });  
     
    +4