the goal data viewbag.array
javascript array. data calculated in controller cannot fetch straight database. need data draw chart jqplot. code:
for(i = 0; < @viewbag.array.length; i++) { jscriptarray[i] = @viewbag.array[i]; }
the problem "'i' not exist in current context" in @viewbag.array[i]
has no problems in jscriptarray[i]
. appreciated.
you may try following:
var array = @html.raw(json.encode(@viewbag.array)); for(var = 0; < array.length; i++) { jscriptarray[i] = array[i]; }
Comments
Post a Comment