i have a returnig list result from controller to View
@model List<CartItemDetailDto>
is it possible to have this result list set to a jquery variable
<script>
var modelList =@(Model);
</script>
i have a returnig list result from controller to View
@model List<CartItemDetailDto>
is it possible to have this result list set to a jquery variable
<script>
var modelList =@(Model);
</script>
Yes you can use that. Just convert in to Json String like below:
var json = @Html.Raw(Json.Encode(@Model));
now you can use your model data in Jquery.