If you are using VS to develop the aspx code you can use
<script>...</script> in the VB code. But if you are using notepad then you must separate the <script> block or it'll be recognized as a script block instead of VB code. I developed the code in VS and then copy to notepad to post the code as stand alone .aspx file and I missed that.

Dim ta As String = "<" & "script language='javascript'>" & vbCrLf
..
..
ta &= "}<" & "/script>" & vbCrLf