I have implement a javascript codes into the sub procedure and execute it by using the RegisterStartupScript. One thing I find out about using the RegisterStartupScript, is that if there is codes after it, it doesn't work. But if I erased all of the codes after it, it will work. How come?

Dim strCreateFile As String
strCreateFile = "<script language='javascript'>"
strCreateFile += "{ var fso = new ActiveXObject('Scripting.FileSystemObject');"
strCreateFile += "var textFile = fso.CreateTextFile('C:\\CUTTER.vts');"
strCreateFile += "var text = 'Version = " + txtVersion.Text + "';"
strCreateFile += "textFile.WriteLine(text);"
strCreateFile += "textFile.Close();}"
strCreateFile += "</script>"

RegisterStartupScript("Startup", strCreateFile)