net and wondering if I could get some get help with this problem. The problem im having is i create an array in vb.net onload and trying to use that array in javascript. Is there anyway I can do do this? An example would be very much appreciated.
2 Answers
I agree with Daok. Lets assume you want to create an html file with some html and script within.
Dim FILE_NAME As String = "C:\myfile.html"
Dim js As String
js="<script language=javascript>" & _
"my_array=" & my_vb_array & ";" & _
"</script>"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(js)
objWriter.Close()
MsgBox("Text written to file")
Else
MsgBox("File Does Not Exist")
End If