Hi Team,
Binding server side list to javascript variable
if i passed static variables, it is working fine but while generating by dynamically in javascript this returns nothing.
Static declaration is var times = ["View", "Edit", "No Access"];
but generating the same by dynamic it is not working.
I followed the below code.
var Data1 = [@foreach (var item in ViewData["Rights"] as List<AAF.Models.Rights_list>)
{
@:{ "ItemName1": "@item.Rights", "ItemName2": "@item.RightsId" },
},];
alert(Data1);
let me know what thing i missed.
Thanks in Advance.