Vasu Gadhiya

Vasu Gadhiya

  • NA
  • 429
  • 102.9k

How To Use JavaScript Variable in Asp.net Inline Code ?

Jul 12 2013 4:42 AM
How To Use JavaScript Variable in Asp.net Inline Code ?

My Code Look like This

----------------------------------------
<%
    String v = "test";
    string[] vt = new string[4] {"aaa", "bbb", "ccc", "ddd"};
%>

<script language="JavaScript1.2">

var scrollercontent=new Array()

for (var i=0;i<3;i++)
scrollercontent.push('<%= vt[i]%>');
}

</script>
----------------------------------------

if I use scrollercontent.push('<%= vt[0]%>'); Than its Print "aaa", but in <%= vt[i]%> variable i cant increase..


 

Answers (3)