I have this Model and return its when form Edit :
public class NewsVM
{
public List<string> Tags{get;set;}
}
and in Action:
public ActionResult Edit()
{
//create instance and fill it
return View(mymodel);
}
and in jQuery in View I want Get Tags and Add All of them to my div . How can I do this ?
I use this but not work :
@if (Model != null)
{
<script type="text/javascript">
for (var i = 0; i < @Model.Tags.Count; i++) {
alert('@Model.Tags["i"]');
}
</script>
}