Bind webgrid with webapi json
how to bind data to webgridthanks
<script>
$(document).ready(
function () {
var id = "4";
debugger;
$.ajax({
url: 'http://localhost:17026/api/Hotelcheck?rating' + id,
type: 'GET',
dataType: "json",
success: function (data) {
$.each(data, function (i, v) {
$('#result').html($('#result').html() + v.HotelCode + '<br />');
});
// debugger;
var datavalue = data;
var myJsonObject = datavalue;
var CarModel = myJsonObject[0].HotelCode;
var CarName = myJsonObject[0].HotelsName;
var CarColor = myJsonObject[0].Location;
// alert(t + t1);
},
error: function (msg) { alert(msg); }
});
});
</script>