I have a list at my Home controller that is :
public List<string> BoomList()
{
List<string> BoomList = new List<string>()
{
"Rohit", "Harish", "Vivek"
};
return BoomList;
}
I want to use the BoomList values at client side using jquery like :
<script type="text/jscript">
$(document).ready(function () {
$("#ButtonID").click(function () {
var url = "/Home/BoomList";
$.get(url, null, function (data) {// data is the list
$("label[for=lblName]").text(data); // How to iterate data here?
});
})
});
</script>
How to iterate through my list(data) here?