Thursday, 26 January 2012

Array in asp.net

Arrays are a special kind of variable that’s tailored for storing related items of the
Same data type. Any one item in an array can be accessed using the array’s name,
Followed by that item’s position in the array

C#  example for better solution

<%@ Page Language="C#" %>
⋮
<script runat="server">
Void Page_Load ()
{
String [] drinkList = new string [4];
DrinkList [0] = "Water";
DrinkList [1] = "Juice";
DrinkList [2] = "Soda";
DrinkList [3] = "Milk";
drinkLabel.Text = drinkList [1];
}
</script>

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Powerade Coupons