Mega Code Archive

 
Categories / ASP.Net Tutorial / Collections
 

Define and use array in asp net page (VB)

<%@ Page Language="VB" %> <script runat="server">    dim arrColors(5) as String        sub Page_Load(Sender as object, e as eventargs)       arrColors(0) = "green"       arrColors(1) = "red"       arrColors(2) = "yellow"       arrColors(3) = "blue"       arrColors(4) = "violet"              Response.Write("The first element is: ")       Response.Write(arrColors(0) & "")              Response.Write("The third element is: ")       Response.Write(arrColors(2) & "")              Response.Write("The 5-3 element is: ")       Response.Write(arrColors(5-3) & "")    end sub       </script> <html><body> </body></html>