First of all, you can't mix server-side and client-side code. The reason is that the protocol that is used to communicate between client and server (i.e. HTTP) doesn't allow this.
Secondly, is this script in an external .js file or embedded in the Page itself? If it's embedded in the Page, then if you look at the source of the web page (in the menubar click on View -> Source) you will see (assuming BSCStr[i] == "test"):
addr=addr + "&C" + i + "=" + test;This means that the browser is expecting a variable named test to have been defined (which obviously hasn't been). If you surround the <%= ... %> with quotation marks, i.e.
addr=addr + "&C" + i + "=" + "<%=BSCStr[i]%>";you will see:
This will result in the following:
Recursion: see Recursion