Hi,
you can add the following code in your page to create an array also
you can edit this code to add your on logic for assigning the values in to
the array.
Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
' Put user code to initialize the page here
Me.RegisterStartupScript("SetFocusScript",
PopulateJavaScriptArray())
End Sub
Private Function PopulateJavaScriptArray() As String
' Declaring the Number of Items in the Array
Dim noOfItems As Integer = 10
Dim myJavaScript As StringBuilder = New StringBuilder()
myJavaScript.Append("<script language='Javascript'>")
myJavaScript.Append(" var myArrayInJavaScript = new Array("+
noOfItems +");")
myJavaScript.Append(" myArrayInJavaScript[5] ='Hello
There...!!';")
myJavaScript.Append(" alert(myArrayInJavaScript[5]);")
myJavaScript.Append("</script>")
Return myJavaScript.ToString()
End Function
HTH
Regards
Ashish M Bhonkiya
"MW" <Pl****@NoSpam.com> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
How can I poplute a javascript array from vb.net? I would prefer to do
this from codebehind.
Michael