Get array element by index (C#)
<%@Page Language="c#" %>
<script runat="server" Language="c#">
void Page_Load()
{
string[] AnimalArray = new string[5]{ "Dog", "Cat", "Elephant", "Lion", "Cat"};
MyLabel.Text = AnimalArray.GetValue(2).ToString();
}
</script>
<html>
<asp:label id="MyLabel" runat="server" />
</html>
Related examples in the same category