I have an application I want to add tags input box
I used http://aehlke.github.io/tag-it/examples.html library
Controller Create Method:
// GET: Posts/Create
public ActionResult Create()
{
var Tags = db.MyTags.Select(t=>t.TagName).ToArray();
ViewBag.ExistingTags = Tags;
return View();
}
View:
I have below script
<script>
$(function(){
//var sampleTags = ['c++', 'java', 'php', 'coldfusion', 'go', 'lua'];
var sampleTags = JSON.stringify(@ViewBag.ExistingTags);
</script>
how can I get the passed ExistingTags array as the sample code commented