Bind binary image in HTML Table from Database using jQuery Ajax and JSON

Last Reply 10 months ago By dharmendr

Posted 11 months ago

hi..

how to create a listview with image using asp.net ajax json html table webmethod ..without using asp.net controls..reply plzz..thanks in advance

function product() {
            
    $.ajax({
        type: "POST",
        url: "/WebService.asmx/products",
        // data: '{}',
        
        contentType: "application/json; charset=utf-8",
        dataType: "json",
         
        success: function (data) {
            
         
            for (var i = 0; i < data.d.length; i++) {
                $("#ttablepdtgrid").append(
                     "<div class=trclass>"+"<tr><td class=tdcolumn>"
                     + "<div class=tabledivprod>"
                      + ' <img class=pdtimgclnt src="data:image/jpg;base64,' + data.d[i].Prodimage + '" />'
                     
                         + "<div class=Proddetails>" + data.d[i].Proddetails + "</div>"
 
                                    
                         + "<div class=Productname>(" + data.d[i].Productname + ")</div>"
                            + "<div class=PdtID>" + data.d[i].PdtID + "</div>" + "<br />"
                 
                    + "</div>"
                + "</td></tr>"+"</div>"
                 );
            }
           getStoresGrid();
        },
        failure: function (response) { alert(response.d); },
        error: function (response) { alert(response.d); }
    });
}

 

This question does not have replies that have been liked.