|
-
Mar 2nd, 2006, 06:43 AM
#1
Thread Starter
Lively Member
How come RegisterStartupScript doesn't work if there is codes on the next line?
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|