Using array of asp inside javascript is not working in the loop
Posted
by Poomjai
on Stack Overflow
See other posts from Stack Overflow
or by Poomjai
Published on 2010-03-12T21:36:23Z
Indexed on
2010/03/13
6:45 UTC
Read the original article
Hit count: 218
ASP.NET
|JavaScript
I have a problem that when i bring the array of asp and use it in the javascript, When i use the counter (i++) and print for each index of array just like "<%=app[i] %>" and it is not return the value back to me. Please help me i solve this problem for a day !!!-Thanks ^_^
edit
<%
String[] asp = {"a","b","c"};
%>
<script language="javascript">
for(var i=0;i<"<%=asp %>".length;i++){
document.write("<%=asp[i] %>")
}
</script>
the error is = Compiler Error Message: CS0103: The name 'i' does not exist in the current context
© Stack Overflow or respective owner